Package io.pravega.common.util
Class Property<T>
- java.lang.Object
-
- io.pravega.common.util.Property<T>
-
public class Property<T> extends java.lang.ObjectRepresents a Property that can be used for configuration.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)TgetDefaultValue()java.lang.StringgetFullName(java.lang.String componentCode)Returns full property name using the specified component code.java.lang.StringgetLegacyName()java.lang.StringgetName()inthashCode()static <T> Property<T>named(java.lang.String name)Creates a new instance of the Property class with no default value.static <T> Property<T>named(java.lang.String name, T defaultValue)Creates a new instance of the Property class with the given default value.static <T> Property<T>named(java.lang.String name, T defaultValue, java.lang.String legacyName)Creates a new instance of the Property class with the given default value.java.lang.StringtoString()
-
-
-
Method Detail
-
named
public static <T> Property<T> named(java.lang.String name)
Creates a new instance of the Property class with no default value.- Type Parameters:
T- The type of the property values.- Parameters:
name- The name of the property.- Returns:
- A new instance of the Property class with no default value.
-
named
public static <T> Property<T> named(java.lang.String name, T defaultValue)
Creates a new instance of the Property class with the given default value.- Type Parameters:
T- The type of the property values.- Parameters:
name- The name of the property.defaultValue- The default value of the property.- Returns:
- A new instance of the Property class with the given default value.
-
named
public static <T> Property<T> named(java.lang.String name, T defaultValue, java.lang.String legacyName)
Creates a new instance of the Property class with the given default value.- Type Parameters:
T- The type of the property values.- Parameters:
name- The name of the property.defaultValue- The default value of the property.legacyName- The old name of the property, for backward compatibility.- Returns:
- A new instance of the Property class with the given default value.
-
getFullName
public java.lang.String getFullName(java.lang.String componentCode)
Returns full property name using the specified component code.- Parameters:
componentCode- the component prefix (`controller.`, `pravegaservice`, etc.)- Returns:
- fully qualified property name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getName
public java.lang.String getName()
-
getDefaultValue
public T getDefaultValue()
-
getLegacyName
public java.lang.String getLegacyName()
-
-