use of io.lumeer.api.model.AttributeLockExceptionGroup in project engine by Lumeer.
the class AttributeLockCodec method convertFromDocument.
public static AttributeLock convertFromDocument(final Document document) {
if (document == null) {
return null;
}
boolean locked = document.getBoolean(LOCKED, false);
List<AttributeLockExceptionGroup> exceptionGroups;
List groupsList = document.get(EXCEPTION_GROUPS, List.class);
if (groupsList != null) {
exceptionGroups = new ArrayList<Document>(groupsList).stream().map(AttributeLockExceptionGroupCodec::convertFromDocument).collect(Collectors.toList());
} else {
exceptionGroups = Collections.emptyList();
}
return new AttributeLock(exceptionGroups, locked);
}
use of io.lumeer.api.model.AttributeLockExceptionGroup in project engine by Lumeer.
the class AttributeLockExceptionGroupCodec method convertFromDocument.
public static AttributeLockExceptionGroup convertFromDocument(final Document document) {
AttributeFilterEquation equation = AttributeFilterEquationCodec.convertFromDocument(document.get(EQUATION, Document.class));
List<String> typeValue = document.getList(TYPE_VALUE, String.class);
String type = document.getString(TYPE);
return new AttributeLockExceptionGroup(equation, typeValue, type);
}
Aggregations