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().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <SOURCE,DESTINATION>
ImmutableExploreResult.Link.Builder<SOURCE, DESTINATION> builder()Creates a builder forLink.static <SOURCE,DESTINATION>
ImmutableExploreResult.Link<SOURCE, DESTINATION> copyOf(ExploreResult.Link<SOURCE, DESTINATION> instance) Creates an immutable copy of aExploreResult.Linkvalue.booleanThis instance is equal to all instances ofLinkthat have equal attribute values.inthashCode()Computes a hash code from attributes:source,destination.static <SOURCE,DESTINATION>
ImmutableExploreResult.Link<SOURCE, DESTINATION> of(SOURCE source, DESTINATION destination) Construct a new immutableLinkinstance.source()toString()Prints the immutable valueLinkwith attribute values.withDestination(DESTINATION value) Copy the current immutable object by setting a value for thedestinationattribute.withSource(SOURCE value) Copy the current immutable object by setting a value for thesourceattribute.
-
Method Details
-
source
- Specified by:
sourcein interfaceExploreResult.Link<SOURCE,DESTINATION> - Returns:
- The value of the
sourceattribute
-
destination
- Specified by:
destinationin interfaceExploreResult.Link<SOURCE,DESTINATION> - Returns:
- The value of the
destinationattribute
-
withSource
Copy the current immutable object by setting a value for thesourceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for source- Returns:
- A modified copy or the
thisobject
-
withDestination
Copy the current immutable object by setting a value for thedestinationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for destination- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofLinkthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:source,destination. -
toString
Prints the immutable valueLinkwith attribute values. -
of
public static <SOURCE,DESTINATION> ImmutableExploreResult.Link<SOURCE,DESTINATION> of(SOURCE source, DESTINATION destination) Construct a new immutableLinkinstance.- Type Parameters:
SOURCE- generic parameter SOURCEDESTINATION- generic parameter DESTINATION- Parameters:
source- The value for thesourceattributedestination- The value for thedestinationattribute- 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 aExploreResult.Linkvalue. 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 SOURCEDESTINATION- 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 forLink.ImmutableExploreResult.Link.<SOURCE, DESTINATION>builder() .source(SOURCE) // requiredsource.destination(DESTINATION) // requireddestination.build();- Type Parameters:
SOURCE- generic parameter SOURCEDESTINATION- generic parameter DESTINATION- Returns:
- A new Link builder
-