public final class CheckParameterUtil extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
CheckParameterUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
ensureParameterNotNull(java.lang.Object value)
Ensures a parameter is not
null. |
static void |
ensureParameterNotNull(java.lang.Object value,
java.lang.String parameterName)
Ensures a parameter is not
null |
static void |
ensureThat(boolean condition,
java.lang.String message)
Ensures that the condition
condition holds. |
static void |
ensureValidCoordinates(EastNorth eastnorth,
java.lang.String parameterName)
Ensures east/north coordinates are valid
|
static void |
ensureValidCoordinates(LatLon latlon,
java.lang.String parameterName)
Ensures lat/lon coordinates are valid
|
static void |
ensureValidNodeId(PrimitiveId id,
java.lang.String parameterName)
Ensures that
id is non-null primitive id of type OsmPrimitiveType.NODE |
static void |
ensureValidPrimitiveId(PrimitiveId id,
java.lang.String parameterName)
Ensures an OSM primitive ID is valid
|
static void |
ensureValidVersion(long version,
java.lang.String parameterName)
Ensures a version number is valid
|
private CheckParameterUtil()
public static void ensureValidPrimitiveId(PrimitiveId id, java.lang.String parameterName) throws java.lang.IllegalArgumentException
id - The id to checkparameterName - The parameter namejava.lang.IllegalArgumentException - if the primitive ID is not valid (negative or zero)public static void ensureValidCoordinates(LatLon latlon, java.lang.String parameterName) throws java.lang.IllegalArgumentException
latlon - The lat/lon to checkparameterName - The parameter namejava.lang.IllegalArgumentException - if the lat/lon are null or not validpublic static void ensureValidCoordinates(EastNorth eastnorth, java.lang.String parameterName) throws java.lang.IllegalArgumentException
eastnorth - The east/north to checkparameterName - The parameter namejava.lang.IllegalArgumentException - if the east/north are null or not validpublic static void ensureValidVersion(long version, java.lang.String parameterName) throws java.lang.IllegalArgumentException
version - The version to checkparameterName - The parameter namejava.lang.IllegalArgumentException - if the version is not valid (negative)public static void ensureParameterNotNull(java.lang.Object value, java.lang.String parameterName) throws java.lang.IllegalArgumentException
nullvalue - The parameter to checkparameterName - The parameter namejava.lang.IllegalArgumentException - if the parameter is nullpublic static void ensureParameterNotNull(java.lang.Object value) throws java.lang.IllegalArgumentException
null. Can find line number in the stack trace, so parameter name is optionalvalue - The parameter to checkjava.lang.IllegalArgumentException - if the parameter is nullpublic static void ensureThat(boolean condition, java.lang.String message) throws java.lang.IllegalArgumentException
condition holds.condition - The condition to checkjava.lang.IllegalArgumentException - if the condition does not holdpublic static void ensureValidNodeId(PrimitiveId id, java.lang.String parameterName) throws java.lang.IllegalArgumentException
id is non-null primitive id of type OsmPrimitiveType.NODEid - the primitive idparameterName - the name of the parameter to be checkedjava.lang.IllegalArgumentException - thrown if id is nulljava.lang.IllegalArgumentException - thrown if id.getType() != NODE