Class PropError

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class PropError
    extends java.lang.Object
    implements java.lang.Cloneable
    Class used to hold errors for a property.
    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      static IPropErrorItem[]EMPTY
      An empty array.
    • Constructor Summary

      Constructors 
      ConstructorDescription
      PropError​(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

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanassign​(PropVerificationError[] verifyErrors)
      Assigns the verification errors.
      PropErrorclone()
      Clones this instance.
      booleanequals​(PropError pe, java.lang.String... ignoredIDs)
      Verification of equality, except the specified the specified ID's.
      booleanequals​(java.lang.Object o)
      Checks if two PropError's are equal, i.e.
      IPropErrorItemget​(java.lang.String id)
      Gets the error input item with specified ID, for none specify empty string.
      IPropErrorItem[]getAll()
      Gets all the errors in an array.
      intgetSeverity()
      Gets the maximum severity of this property error instance.
      booleanisEmpty()
      Checks if the error items are empty.
      java.lang.StringtoString()
      Formats the error input to a string.
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PropError

        public PropError​(IPropErrorItem item)
        Creates a new instance of the errors property initialized with one errors item.
        Parameters:
        item - An input error item.
        Throws:
        java.lang.NullPointerException - If input or message is null.
      • PropError

        public PropError​(IPropErrorItem[] items)
        Creates a new instance of the errors property initialized with one errors item.
        Parameters:
        items - An array of input error items.
        Throws:
        java.lang.NullPointerException - If input or message is null.
    • Method Detail

      • 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.
      • get

        public IPropErrorItem get​(java.lang.String id)
        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

        public IPropErrorItem[] getAll()
        Gets all the errors in an array.
        Returns:
        An array copy of the errors, never null.
      • assign

        public boolean assign​(PropVerificationError[] verifyErrors)
        Assigns the verification errors.
        Parameters:
        verifyErrors - The set of verification errors.
        Returns:
        true for changes, false for no change.
      • toString

        public java.lang.String toString()
        Formats the error input to a string.
        Overrides:
        toString in class java.lang.Object
      • clone

        public PropError clone()
        Clones this instance.
        Overrides:
        clone in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Checks if two PropError's are equal, i.e. that the errors are all present, ordering doesn't matter.
        Overrides:
        equals in class java.lang.Object
      • equals

        public boolean equals​(PropError pe,
                              java.lang.String... ignoredIDs)
        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.