Package org.openwms.common.location
Class LocationPK
java.lang.Object
org.openwms.common.location.LocationPK
- All Implemented Interfaces:
Serializable
A LocationPK, is a value type and is used as an unique natural key for
Location
entities.- Author:
- Heiko Scherrer
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
LocationPK
builder static inner class. -
Field Summary
Modifier and TypeFieldDescriptionprivate @Max(4L) String
Expresses the aisle theLocation
belongs to.private @Max(4L) String
Expresses the area theLocation
belongs to.static final short
static final short
static final short
Returns the complete length of all keys.private @Max(4L) String
Expresses the x-dimension theLocation
belongs to.private @Max(4L) String
Expresses the y-dimension theLocation
belongs to.private @Max(4L) String
Expresses the z-dimension theLocation
belongs to. -
Constructor Summary
ModifierConstructorDescriptionprotected
Dear JPA ...LocationPK
(String... keys) Weak constructor to create a new LocationPK with a couple of keys only.Create a new LocationPK with all required fields.private
LocationPK
(LocationPK.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static LocationPK
fromString
(String s) getAisle()
Get the aisle region.getArea()
Get the area region.getX()
Get the x-dimension.getY()
Get the y-dimension.getZ()
Get the z-dimension.int
hashCode()
static boolean
static LocationPK.Builder
Create a new builder instance to create LocationPK from.toString()
Return a String like AREA/AISLE/X/Y/Z.
-
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_LENGTHReturns 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
Expresses the area theLocation
belongs to. -
aisle
Expresses the aisle theLocation
belongs to. -
x
Expresses the x-dimension theLocation
belongs to. -
y
Expresses the y-dimension theLocation
belongs to. -
z
Expresses the z-dimension theLocation
belongs to.
-
-
Constructor Details
-
LocationPK
protected LocationPK()Dear JPA ... -
LocationPK
Create a new LocationPK with all required fields.- Parameters:
area
- Area where theLocation
belongs toaisle
- Aisle where theLocation
belongs tox
- Dimension x where theLocation
belongs toy
- Dimension y where theLocation
belongs toz
- Dimension z where theLocation
belongs to
-
LocationPK
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 matchNUMBER_OF_KEYS
-
LocationPK
-
-
Method Details
-
fromString
-
isValid
-
newBuilder
Create a new builder instance to create LocationPK from.- Returns:
- The builder
-
getArea
Get the area region.- Returns:
- The area
-
getAisle
Get the aisle region.- Returns:
- The aisle
-
getX
Get the x-dimension.- Returns:
- The x-dimension
-
getY
Get the y-dimension.- Returns:
- The y-dimension
-
getZ
Get the z-dimension.- Returns:
- The z-dimension
-
equals
-
hashCode
public int hashCode() -
toString
Return a String like AREA/AISLE/X/Y/Z.
-