[OLINGO-1330] cache name in getName()

This commit is contained in:
mibo 2019-05-10 17:59:17 +02:00
parent ebf05a5e64
commit 24fed9b1b6
1 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,8 @@ import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
*/
public abstract class SingletonPrimitiveType extends AbstractPrimitiveType {
protected String name;
@Override
public boolean equals(final Object obj) {
return this == obj || obj != null && getClass() == obj.getClass();
@ -42,7 +44,10 @@ public abstract class SingletonPrimitiveType extends AbstractPrimitiveType {
@Override
public String getName() {
return getClass().getSimpleName().substring(3);
if(name == null) {
name = getClass().getSimpleName().substring(3);
}
return name;
}
@Override