This commit is contained in:
Lucio Lelii 2018-05-04 12:25:27 +00:00
parent 397add5f3e
commit aff8ca2030
6 changed files with 28 additions and 8 deletions

View File

@ -5,6 +5,10 @@ import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
@JsonAutoDetect(fieldVisibility=Visibility.ANY, getterVisibility=Visibility.NONE, isGetterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE)
public class Path {
protected List<String> paths = null;
@ -21,6 +25,7 @@ public class Path {
else return "/"+paths.stream().collect(Collectors.joining("/"))+"/";
}
public String getLastDirName(){
return paths.get(paths.size()-1);
}

View File

@ -13,6 +13,8 @@ public class Before implements Expression<Boolean> {
private SearchableField<Calendar> searchableField;
private Calendar value;
protected Before() {}
public Before(SearchableField<Calendar> searchableField, Calendar value) {
super();
this.searchableField = searchableField;

View File

@ -14,7 +14,9 @@ public class And implements Expression<Boolean>{
protected And() {}
public And(Expression<Boolean> first , Expression<Boolean> second , Expression<Boolean> ... others ) {
expressions = Arrays.asList(first, second);
expressions = new ArrayList<>(2);
expressions.add(first);
expressions.add(second);
if (others !=null && others.length>0)
expressions.addAll(Arrays.asList(others));
}

View File

@ -7,6 +7,8 @@ public class ISDescendant implements Expression<Boolean>{
private Path path;
protected ISDescendant() {}
public ISDescendant(Path path) {
this.path = path;
}

View File

@ -11,6 +11,8 @@ public class Or implements Expression<Boolean>{
List<Expression<Boolean>> expressions = new ArrayList<>();
protected Or() {}
public Or(Expression<Boolean> first , Expression<Boolean> second , Expression<Boolean> ... others ) {
expressions = Arrays.asList(first, second);
if (others !=null && others.length>0)

View File

@ -1,16 +1,15 @@
package org.gcube.common.storagehub.model.items.nodes;
import java.util.HashMap;
import java.util.Map;
import java.util.Calendar;
import org.gcube.common.storagehub.model.annotations.Attribute;
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
import org.gcube.common.storagehub.model.annotations.MapAttribute;
@Getter
@Setter
@NoArgsConstructor
@ -18,7 +17,15 @@ import org.gcube.common.storagehub.model.annotations.MapAttribute;
@AttributeRootNode("nthl:accountingEntry")
public class AccountEntry {
@MapAttribute
Map<String, Object> account = new HashMap<String, Object>();;
@Attribute("hl:user")
String user;
@Attribute("hl:date")
Calendar date;
@Attribute("hl:version")
String version;
}