Class ImmutableExploreResult.Link<SOURCE,DESTINATION>

java.lang.Object
fr.enedis.chutney.agent.domain.explore.ImmutableExploreResult.Link<SOURCE,DESTINATION>
All Implemented Interfaces:
ExploreResult.Link<SOURCE,DESTINATION>
Enclosing class:
ImmutableExploreResult

@Generated(from="ExploreResult.Link", generator="Immutables") @Immutable @CheckReturnValue public static final class ImmutableExploreResult.Link<SOURCE,DESTINATION> extends Object implements ExploreResult.Link<SOURCE,DESTINATION>
Immutable implementation of ExploreResult.Link.

Use the builder to create immutable instances: ImmutableExploreResult.Link.builder(). Use the static factory method to create immutable instances: ImmutableExploreResult.Link.of().

  • Method Details

    • source

      public SOURCE source()
      Specified by:
      source in interface ExploreResult.Link<SOURCE,DESTINATION>
      Returns:
      The value of the source attribute
    • destination

      public DESTINATION destination()
      Specified by:
      destination in interface ExploreResult.Link<SOURCE,DESTINATION>
      Returns:
      The value of the destination attribute
    • withSource

      public final ImmutableExploreResult.Link<SOURCE,DESTINATION> withSource(SOURCE value)
      Copy the current immutable object by setting a value for the source attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for source
      Returns:
      A modified copy or the this object
    • withDestination

      public final ImmutableExploreResult.Link<SOURCE,DESTINATION> withDestination(DESTINATION value)
      Copy the current immutable object by setting a value for the destination attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for destination
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Link 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: source, destination.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <SOURCE, DESTINATION> ImmutableExploreResult.Link<SOURCE,DESTINATION> of(SOURCE source, DESTINATION destination)
      Construct a new immutable Link instance.
      Type Parameters:
      SOURCE - generic parameter SOURCE
      DESTINATION - generic parameter DESTINATION
      Parameters:
      source - The value for the source attribute
      destination - The value for the destination attribute
      Returns:
      An immutable Link instance
    • copyOf

      public static <SOURCE, DESTINATION> ImmutableExploreResult.Link<SOURCE,DESTINATION> copyOf(ExploreResult.Link<SOURCE,DESTINATION> instance)
      Creates an immutable copy of a ExploreResult.Link value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      SOURCE - generic parameter SOURCE
      DESTINATION - generic parameter DESTINATION
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Link instance
    • builder

      public static <SOURCE, DESTINATION> ImmutableExploreResult.Link.Builder<SOURCE,DESTINATION> builder()
      Creates a builder for Link.
       ImmutableExploreResult.Link.<SOURCE, DESTINATION>builder()
          .source(SOURCE) // required source
          .destination(DESTINATION) // required destination
          .build();
       
      Type Parameters:
      SOURCE - generic parameter SOURCE
      DESTINATION - generic parameter DESTINATION
      Returns:
      A new Link builder