Class ImmutableExploreResult.Link<SOURCE,DESTINATION>
- java.lang.Object
-
- com.chutneytesting.agent.domain.explore.ImmutableExploreResult.Link<SOURCE,DESTINATION>
-
- All Implemented Interfaces:
ExploreResult.Link<SOURCE,DESTINATION>
- Enclosing class:
- ImmutableExploreResult
@Immutable @CheckReturnValue public static final class ImmutableExploreResult.Link<SOURCE,DESTINATION> extends Object implements ExploreResult.Link<SOURCE,DESTINATION>
Immutable implementation ofExploreResult.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 Modifier and Type Class Description static classImmutableExploreResult.Link.Builder<SOURCE,DESTINATION>Builds instances of typeLink.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <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.DESTINATIONdestination()booleanequals(Object another)This 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.SOURCEsource()StringtoString()Prints the immutable valueLinkwith attribute values.ImmutableExploreResult.Link<SOURCE,DESTINATION>withDestination(DESTINATION value)Copy the current immutable object by setting a value for thedestinationattribute.ImmutableExploreResult.Link<SOURCE,DESTINATION>withSource(SOURCE value)Copy the current immutable object by setting a value for thesourceattribute.
-
-
-
Method Detail
-
source
public SOURCE source()
- Specified by:
sourcein interfaceExploreResult.Link<SOURCE,DESTINATION>- Returns:
- The value of the
sourceattribute
-
destination
public DESTINATION destination()
- Specified by:
destinationin interfaceExploreResult.Link<SOURCE,DESTINATION>- Returns:
- The value of the
destinationattribute
-
withSource
public final ImmutableExploreResult.Link<SOURCE,DESTINATION> withSource(SOURCE value)
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 of the
thisobject
-
withDestination
public final ImmutableExploreResult.Link<SOURCE,DESTINATION> withDestination(DESTINATION value)
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 of the
thisobject
-
equals
public boolean equals(@Nullable Object another)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
public String 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
-
-