Package com.google.common.base
Class CaseFormat.StringConverter
- java.lang.Object
-
- com.google.common.base.Converter<java.lang.String,java.lang.String>
-
- com.google.common.base.CaseFormat.StringConverter
-
- All Implemented Interfaces:
Function<java.lang.String,java.lang.String>,java.io.Serializable,java.util.function.Function<java.lang.String,java.lang.String>
- Enclosing class:
- CaseFormat
private static final class CaseFormat.StringConverter extends Converter<java.lang.String,java.lang.String> implements java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDprivate CaseFormatsourceFormatprivate CaseFormattargetFormat
-
Constructor Summary
Constructors Constructor Description StringConverter(CaseFormat sourceFormat, CaseFormat targetFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringdoBackward(java.lang.String s)Returns a representation ofbas an instance of typeA.protected java.lang.StringdoForward(java.lang.String s)Returns a representation ofaas an instance of typeB.booleanequals(java.lang.Object object)Indicates whether another object is equal to this converter.inthashCode()java.lang.StringtoString()-
Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, correctedDoBackward, correctedDoForward, doAndThen, from, identity, reverse
-
-
-
-
Field Detail
-
sourceFormat
private final CaseFormat sourceFormat
-
targetFormat
private final CaseFormat targetFormat
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringConverter
StringConverter(CaseFormat sourceFormat, CaseFormat targetFormat)
-
-
Method Detail
-
doForward
protected java.lang.String doForward(java.lang.String s)
Description copied from class:ConverterReturns a representation ofaas an instance of typeB. Ifacannot be converted, an unchecked exception (such asIllegalArgumentException) should be thrown.
-
doBackward
protected java.lang.String doBackward(java.lang.String s)
Description copied from class:ConverterReturns a representation ofbas an instance of typeA. Ifbcannot be converted, an unchecked exception (such asIllegalArgumentException) should be thrown.- Specified by:
doBackwardin classConverter<java.lang.String,java.lang.String>- Parameters:
s- the instance to convert; will never be null- Returns:
- the converted instance; must not be null
-
equals
public boolean equals(java.lang.Object object)
Description copied from class:ConverterIndicates whether another object is equal to this converter.Most implementations will have no reason to override the behavior of
Object.equals(java.lang.Object). However, an implementation may also choose to returntruewheneverobjectis aConverterthat it considers interchangeable with this one. "Interchangeable" typically means thatObjects.equal(this.convert(a), that.convert(a))is true for allaof typeA(and similarly forreverse). Note that afalseresult from this method does not imply that the converters are known not to be interchangeable.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-