Class AbstractCharAttributeValue
- java.lang.Object
-
- com.impossibl.postgres.protocol.sasl.scram.util.AbstractStringWritable
-
- com.impossibl.postgres.protocol.sasl.scram.util.AbstractCharAttributeValue
-
- All Implemented Interfaces:
CharAttribute
,CharAttributeValue
,StringWritable
- Direct Known Subclasses:
Gs2AttributeValue
,ScramAttributeValue
public class AbstractCharAttributeValue extends AbstractStringWritable implements CharAttributeValue
Construct and write generic CharAttribute-Value pairs. Concrete sub-classes should also provide a static parse(String) creation method.
-
-
Constructor Summary
Constructors Constructor Description AbstractCharAttributeValue(CharAttribute charAttribute, String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
getChar()
Return the char used to represent this attributeString
getValue()
Returns the value associated with theCharAttribute
StringBuffer
writeTo(StringBuffer sb)
Write the class information to the given StringBuffer.-
Methods inherited from class com.impossibl.postgres.protocol.sasl.scram.util.AbstractStringWritable
toString
-
-
-
-
Constructor Detail
-
AbstractCharAttributeValue
public AbstractCharAttributeValue(CharAttribute charAttribute, String value) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
getChar
public char getChar()
Description copied from interface:CharAttribute
Return the char used to represent this attribute- Specified by:
getChar
in interfaceCharAttribute
- Returns:
- The character of the attribute
-
getValue
public String getValue()
Description copied from interface:CharAttributeValue
Returns the value associated with theCharAttribute
- Specified by:
getValue
in interfaceCharAttributeValue
- Returns:
- The String value or null if no value is associated
-
writeTo
public StringBuffer writeTo(StringBuffer sb)
Description copied from interface:StringWritable
Write the class information to the given StringBuffer.- Specified by:
writeTo
in interfaceStringWritable
- Parameters:
sb
- Where to write the data.- Returns:
- The same StringBuffer.
-
-