com.geotab.model.entity.unitofmeasure.UnitOfMeasureSystem Maven / Gradle / Ivy
package com.geotab.model.entity.unitofmeasure;
import com.geotab.model.Id;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Represents a system supported unit of measure which cannot be changed.
*/
@Getter @Setter
@NoArgsConstructor
public class UnitOfMeasureSystem extends UnitOfMeasure {
private static class InstanceHolder {
private static final UnitOfMeasureSystem INSTANCE = new UnitOfMeasureSystem();
}
protected UnitOfMeasureSystem(String id, String name) {
setId(new Id(id));
setName(name);
}
@Override
public boolean isSystemEntity() {
return true;
}
public static UnitOfMeasureSystem getInstance() {
return UnitOfMeasureSystem.InstanceHolder.INSTANCE;
}
}