Class ZoneConnection

java.lang.Object
com.dna.jopt.member.unit.zonemanager.AbstractZoneConnection
com.dna.jopt.member.unit.zonemanager.ZoneConnection

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ZoneConnection extends AbstractZoneConnection
Immutable implementation of AbstractZoneConnection.

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

  • Method Details

    • fromZoneId

      public String fromZoneId()
      Specified by:
      fromZoneId in class AbstractZoneConnection
      Returns:
      The value of the fromZoneId attribute
    • toZoneId

      public String toZoneId()
      Specified by:
      toZoneId in class AbstractZoneConnection
      Returns:
      The value of the toZoneId attribute
    • crossingPenaltyMultiplier

      public double crossingPenaltyMultiplier()
      Overrides:
      crossingPenaltyMultiplier in class AbstractZoneConnection
      Returns:
      The value of the crossingPenaltyMultiplier attribute
    • withFromZoneId

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

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

      public final ZoneConnection withCrossingPenaltyMultiplier(double value)
      Copy the current immutable object by setting a value for the crossingPenaltyMultiplier attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for crossingPenaltyMultiplier
      Returns:
      A modified copy of the this object
    • equals

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

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

      public static ZoneConnection of(String fromZoneId, String toZoneId)
      Construct a new immutable ZoneConnection instance.
      Parameters:
      fromZoneId - The value for the fromZoneId attribute
      toZoneId - The value for the toZoneId attribute
      Returns:
      An immutable ZoneConnection instance
    • copyOf

      public static ZoneConnection copyOf(AbstractZoneConnection instance)
      Creates an immutable copy of a AbstractZoneConnection 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 ZoneConnection instance
    • builder

      public static ZoneConnection.FromZoneIdBuildStage builder()
      Creates a builder for ZoneConnection.
       ZoneConnection.builder()
          .fromZoneId(String) // required fromZoneId
          .toZoneId(String) // required toZoneId
          .crossingPenaltyMultiplier(double) // optional crossingPenaltyMultiplier
          .build();
       
      Returns:
      A new ZoneConnection builder