Class LocationPK

java.lang.Object
org.openwms.common.location.LocationPK
All Implemented Interfaces:
Serializable

public class LocationPK extends Object implements Serializable
A LocationPK, is a value type and is used as an unique natural key for Location entities.
Author:
Heiko Scherrer
See Also:
  • Field Details

    • KEY_LENGTH

      public static final short KEY_LENGTH
      See Also:
    • NUMBER_OF_KEYS

      public static final short NUMBER_OF_KEYS
      See Also:
    • PK_LENGTH

      public static final short PK_LENGTH
      Returns the complete length of all keys. Currently all keys have the same length, therefore it is the 5 times the length of a single key (KEY_LENGTH). But since this can change the actual length is encapsulated within this method.
      See Also:
    • area

      @Max(4L) private @Max(4L) String area
      Expresses the area the Location belongs to.
    • aisle

      @Max(4L) private @Max(4L) String aisle
      Expresses the aisle the Location belongs to.
    • x

      @Max(4L) private @Max(4L) String x
      Expresses the x-dimension the Location belongs to.
    • y

      @Max(4L) private @Max(4L) String y
      Expresses the y-dimension the Location belongs to.
    • z

      @Max(4L) private @Max(4L) String z
      Expresses the z-dimension the Location belongs to.
  • Constructor Details

    • LocationPK

      protected LocationPK()
      Dear JPA ...
    • LocationPK

      public LocationPK(String area, String aisle, String x, String y, String z)
      Create a new LocationPK with all required fields.
      Parameters:
      area - Area where the Location belongs to
      aisle - Aisle where the Location belongs to
      x - Dimension x where the Location belongs to
      y - Dimension y where the Location belongs to
      z - Dimension z where the Location belongs to
    • LocationPK

      public LocationPK(String... keys)
      Weak constructor to create a new LocationPK with a couple of keys only.
      Parameters:
      keys - The array of keys, currently expected to be 5
      Throws:
      IllegalArgumentException - if the number of keys does not match NUMBER_OF_KEYS
    • LocationPK

      private LocationPK(LocationPK.Builder builder)
  • Method Details

    • fromString

      public static LocationPK fromString(String s)
    • isValid

      public static boolean isValid(String locationPk)
    • newBuilder

      public static LocationPK.Builder newBuilder()
      Create a new builder instance to create LocationPK from.
      Returns:
      The builder
    • getArea

      public String getArea()
      Get the area region.
      Returns:
      The area
    • getAisle

      public String getAisle()
      Get the aisle region.
      Returns:
      The aisle
    • getX

      public String getX()
      Get the x-dimension.
      Returns:
      The x-dimension
    • getY

      public String getY()
      Get the y-dimension.
      Returns:
      The y-dimension
    • getZ

      public String getZ()
      Get the z-dimension.
      Returns:
      The z-dimension
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • toString

      public String toString()
      Return a String like AREA/AISLE/X/Y/Z.
      Overrides:
      toString in class Object
      Returns:
      String
      See Also: