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:
-
Field Summary
Modifier and TypeFieldDescriptionprivate @Size(max=4) String
Expresses the aisle theLocation
belongs to.private @Size(max=4) String
Expresses the area theLocation
belongs to.static final short
static final short
static final short
Returns the complete length of all keys.private @Size(max=4) String
Expresses the x-dimension theLocation
belongs to.private @Size(max=4) String
Expresses the y-dimension theLocation
belongs to.private @Size(max=4) String
Expresses the z-dimension theLocation
belongs to. -
Constructor Summary
ModifierConstructorDescriptionprotected
Dear JPA ...private
LocationPK
(String... keys) Weak constructor to create a new LocationPK with a couple of keys only. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static LocationPK
fromString
(String s) Create aLocationPK
from the given String.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
Checks whether the givenlocationPK
String is in valid format.static LocationPK
Create a new LocationPK with all required fields.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
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
-
-
Method Details
-
of
Create a new LocationPK with all required fields. -
fromString
Create aLocationPK
from the given String.- Parameters:
s
- The String, not null- Returns:
- An instance
-
isValid
Checks whether the givenlocationPK
String is in valid format.- Parameters:
locationPk
- The String to verify- Returns:
- true if valid
-
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.
-