Class 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 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 Detail

      • 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 of 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 of 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.&lt;SOURCE, DESTINATION&gt;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