Package org.bytemechanics.config.manager
Class Config
java.lang.Object
org.bytemechanics.config.manager.Config
- All Implemented Interfaces:
java.lang.Comparable<Config>
public class Config extends java.lang.Object implements java.lang.Comparable<Config>
Configuration bean
- Author:
- afarre
- See Also:
Comparable
-
Constructor Summary
Constructors Constructor Description Config(java.lang.String _key, java.lang.String _value)
Builds configuraiton from the given key/value pairs -
Method Summary
Modifier and Type Method Description int
compareTo(Config _other)
boolean
equals(java.lang.Object _other)
java.lang.String
getKey()
Retrieve key valuejava.lang.String
getValue()
Retrieve valueint
hashCode()
static Config
of(java.lang.String _key, java.lang.String _value)
Utility method to call constructor without newjava.lang.String
toString()
-
Constructor Details
-
Config
public Config(java.lang.String _key, java.lang.String _value)Builds configuraiton from the given key/value pairs- Parameters:
_key
- key to store_value
- value to store- Throws:
java.lang.NullPointerException
- if the given _key is null
-
-
Method Details
-
getKey
public java.lang.String getKey()Retrieve key value- Returns:
- configuration key value
-
getValue
public java.lang.String getValue()Retrieve value- Returns:
- configuration value
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object _other)- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<Config>
- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
of
Utility method to call constructor without new- Parameters:
_key
- key to store_value
- value to store- Returns:
- new Config created
- Throws:
java.lang.NullPointerException
- if the given _key is null
-