Class PropInfo

  • All Implemented Interfaces:
    java.io.Serializable

    public final class PropInfo
    extends java.lang.Object
    implements java.io.Serializable
    Author:
    Martin Adamek
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PropInfo()  
      PropInfo​(java.lang.String name, java.lang.String value)  
    • Constructor Detail

      • PropInfo

        public PropInfo()
      • PropInfo

        public PropInfo​(java.lang.String name,
                        java.lang.String value)
    • Method Detail

      • getName

        public java.lang.String getName()
      • getValue

        public java.lang.String getValue()
      • findByKey

        public static PropInfo findByKey​(java.util.Collection<PropInfo> collection,
                                         java.lang.String name)
        Searches given collection for PropInfo defined by given key name
        Parameters:
        collection - Where to search
        name - PropInfo key name
        Returns:
        The found PropInfo or null if no PropInfo with such key exists
      • addOrUpdateProperty

        public static java.util.List<PropInfo> addOrUpdateProperty​(java.util.List<PropInfo> props,
                                                                   java.lang.String name,
                                                                   java.lang.String value)
        Adds or updates PropInfo in the list. It will create a copy of the props list, which will contain a new PropInfo instance for the property specified by name and value. If a PropInfo instance with the same name and value already exists in the list, this method will return the new list without any further changes.
        Parameters:
        props - The list of original PropInfos.
        name - The name of the property.
        value - The value of the property.
        Returns:
        A new list of PropInfos that contains the new property.
      • removeProperty

        public static java.util.List<PropInfo> removeProperty​(java.util.List<PropInfo> props,
                                                              java.lang.String name)
        Removes a PropInfo from the list. This method will create a copy of the props list and remove the PropInfo instance identified by the name parameter. If such instance exists.
        Parameters:
        props - The list of original PropInfos
        name - The name of the property
        Returns:
        A new list of PropInfos with the property removed.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeProperties

        public static void writeProperties​(java.lang.StringBuilder b,
                                           java.util.Collection<PropInfo> props,
                                           java.lang.String sep)
      • toStringHelper

        public static java.util.List<? extends java.lang.String> toStringHelper​(java.util.List<? extends PropInfo> list)
      • toStringHelper

        public static java.lang.String toStringHelper​(PropInfo info)