Package com.im.ijcs.api.ddl.dto
Class PropInfo
- java.lang.Object
-
- com.im.ijcs.api.ddl.dto.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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<PropInfo>
addOrUpdateProperty(java.util.List<PropInfo> props, java.lang.String name, java.lang.String value)
Adds or updatesPropInfo
in the list.static PropInfo
findByKey(java.util.Collection<PropInfo> collection, java.lang.String name)
Searches given collection for PropInfo defined by given key namejava.lang.String
getName()
java.lang.String
getValue()
static java.util.List<PropInfo>
removeProperty(java.util.List<PropInfo> props, java.lang.String name)
Removes aPropInfo
from the list.java.lang.String
toString()
static java.lang.String
toStringHelper(PropInfo info)
static java.util.List<? extends java.lang.String>
toStringHelper(java.util.List<? extends PropInfo> list)
static void
writeProperties(java.lang.StringBuilder b, java.util.Collection<PropInfo> props, java.lang.String sep)
-
-
-
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 searchname
- 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 updatesPropInfo
in the list. It will create a copy of theprops
list, which will contain a newPropInfo
instance for the property specified byname
andvalue
. If aPropInfo
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 originalPropInfo
s.name
- The name of the property.value
- The value of the property.- Returns:
- A new list of
PropInfo
s that contains the new property.
-
removeProperty
public static java.util.List<PropInfo> removeProperty(java.util.List<PropInfo> props, java.lang.String name)
Removes aPropInfo
from the list. This method will create a copy of theprops
list and remove thePropInfo
instance identified by thename
parameter. If such instance exists.- Parameters:
props
- The list of originalPropInfo
sname
- The name of the property- Returns:
- A new list of
PropInfo
s with the property removed.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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)
-
-