@Immutable
@Internal
public final class AccessorTemplate
extends java.lang.Object
implements java.io.Serializable
An accessor always has a prefix (e.g. get...
) and may have a postfix
(e.g. ...Count
).
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
format(io.spine.code.gen.java.FieldName field)
Formats an accessor method name based on this template and the given field name.
|
int |
hashCode() |
static AccessorTemplate |
prefix(java.lang.String prefix)
Creates a new template with the given prefix and an empty postfix.
|
static AccessorTemplate |
prefixAndPostfix(java.lang.String prefix,
java.lang.String suffix)
Creates a new template with the given prefix and postfix.
|
java.lang.String |
toString() |
public static AccessorTemplate prefix(java.lang.String prefix)
public static AccessorTemplate prefixAndPostfix(java.lang.String prefix, java.lang.String suffix)
public java.lang.String format(io.spine.code.gen.java.FieldName field)
field
- the name of the field to accesspublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object