Package com.iizix.prop
Class PropError
java.lang.Object
com.iizix.prop.PropError
- All Implemented Interfaces:
Cloneable
Class used to hold errors for a property.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionstatic IPropErrorItem[]
An empty array.static final String
Property errors with an ID starting with this string are circular reference errors or crossovers into circular references.Constructor Summary
ConstructorDescriptionPropError
(IPropErrorItem item) Creates a new instance of the errors property initialized with one errors item.PropError
(IPropErrorItem[] items) Creates a new instance of the errors property initialized with one errors item.Method Summary
Modifier and TypeMethodDescriptionboolean
assign
(PropVerificationError[] verifyErrors) Assigns the verification errors.clone()
Clones this instance.boolean
Verification of equality, except the specified the specified ID's.boolean
Checks if two PropError's are equal, i.e.Gets the error input item with specified ID, for none specify empty string.getAll()
Gets all the errors in an array.int
Gets the maximum severity of this property error instance.boolean
Checks if there is any presence of a circular reference error.boolean
isEmpty()
Checks if the error items are empty.toString()
Formats the error input to a string.
Field Details
PROP_ERROR_ID_CIRCULAR_REFERENCE
Property errors with an ID starting with this string are circular reference errors or crossovers into circular references.- See Also:
EMPTY
An empty array.
Constructor Details
PropError
Creates a new instance of the errors property initialized with one errors item.- Parameters:
item
- An input error item.- Throws:
NullPointerException
- If input or message is null.
PropError
Creates a new instance of the errors property initialized with one errors item.- Parameters:
items
- An array of input error items.- Throws:
NullPointerException
- If input or message is null.
Method Details
getSeverity
public int getSeverity()Gets the maximum severity of this property error instance.- Returns:
- -1 if no errors, otherwise IPropErrorItem.INFO=0, WARNING=1 or ERROR=2.
isEmpty
public boolean isEmpty()Checks if the error items are empty.hasCircularReferencesError
public boolean hasCircularReferencesError()Checks if there is any presence of a circular reference error.- Returns:
true
if there is at least one circular reference error, or a crossover to a circular reference,false
otherwise.
get
Gets the error input item with specified ID, for none specify empty string.- Parameters:
id
- The ID for the error, can be empty string (null means default empty string).- Returns:
- The error item for the ID, or null for not found.
getAll
Gets all the errors in an array.- Returns:
- An array copy of the errors, never null.
assign
Assigns the verification errors.- Parameters:
verifyErrors
- The set of verification errors.- Returns:
- true for changes, false for no change.
toString
Formats the error input to a string.clone
Clones this instance.equals
Checks if two PropError's are equal, i.e. that the errors are all present, ordering doesn't matter.equals
Verification of equality, except the specified the specified ID's.- Parameters:
pe
- Compare with this error property.ignoredIDs
- Ignored error IDs.- Returns:
- true if equal, false otherwise.