Package com.google.common.base
Class CaseFormat.StringConverter
- Enclosing class:
CaseFormat
private static final class CaseFormat.StringConverter
extends Converter<String,String>
implements Serializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
private final CaseFormat
private final CaseFormat
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.google.common.base.Converter
andThen, apply, convert, convertAll, correctedDoBackward, correctedDoForward, doAndThen, from, identity, reverse
-
Field Details
-
sourceFormat
-
targetFormat
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
StringConverter
StringConverter(CaseFormat sourceFormat, CaseFormat targetFormat)
-
-
Method Details
-
doForward
Description copied from class:Converter
Returns a representation ofa
as an instance of typeB
. Ifa
cannot be converted, an unchecked exception (such asIllegalArgumentException
) should be thrown. -
doBackward
Description copied from class:Converter
Returns a representation ofb
as an instance of typeA
. Ifb
cannot be converted, an unchecked exception (such asIllegalArgumentException
) should be thrown.- Specified by:
doBackward
in classConverter<String,
String> - Parameters:
s
- the instance to convert; will never be null- Returns:
- the converted instance; must not be null
-
equals
Description copied from class:Converter
Indicates 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 returntrue
wheneverobject
is aConverter
that it considers interchangeable with this one. "Interchangeable" typically means thatObjects.equal(this.convert(a), that.convert(a))
is true for alla
of typeA
(and similarly forreverse
). Note that afalse
result from this method does not imply that the converters are known not to be interchangeable. -
hashCode
public int hashCode() -
toString
-