Class ImmutableRepo

java.lang.Object
io.jenkins.plugins.trunk.model.ImmutableRepo
All Implemented Interfaces:
Repo

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableRepo extends Object implements Repo
Immutable implementation of Repo.

Use the builder to create immutable instances: ImmutableRepo.builder().

  • Method Details

    • host

      public String host()
      Specified by:
      host in interface Repo
      Returns:
      The value of the host attribute
    • owner

      public String owner()
      Specified by:
      owner in interface Repo
      Returns:
      The value of the owner attribute
    • name

      public String name()
      Specified by:
      name in interface Repo
      Returns:
      The value of the name attribute
    • withHost

      public final ImmutableRepo withHost(String value)
      Copy the current immutable object by setting a value for the host attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for host
      Returns:
      A modified copy of the this object
    • withOwner

      public final ImmutableRepo withOwner(String value)
      Copy the current immutable object by setting a value for the owner attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for owner
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutableRepo withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableRepo that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: host, owner, name.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Repo with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableRepo copyOf(Repo instance)
      Creates an immutable copy of a Repo value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Repo instance
    • builder

      public static ImmutableRepo.Builder builder()
      Creates a builder for ImmutableRepo.
       ImmutableRepo.builder()
          .host(String) // required host
          .owner(String) // required owner
          .name(String) // required name
          .build();
       
      Returns:
      A new ImmutableRepo builder