Skip to content

Commit

Permalink
Fix missing filters in public view of job configuration.
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Chrzan <[email protected]>
Signed-off-by: mchrza <[email protected]>
  • Loading branch information
mchrza committed Nov 11, 2024
1 parent b1d83e8 commit 7e98d8b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
import com.here.xyz.events.PropertiesQuery;
import com.here.xyz.util.Hasher;

import java.util.ArrayList;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Filters {
@JsonView({Public.class})
@JsonView({Public.class, Static.class})
private PropertiesQuery propertyFilter;
//TODO: Remove after V1 got shutdown
@JsonView({Internal.class, Static.class})
Expand All @@ -51,8 +53,9 @@ public PropertiesQuery getPropertyFilter() {
}

public void setPropertyFilter(Object propertyFilter) {
if (propertyFilter instanceof PropertiesQuery propFilter)
this.propertyFilter = propFilter;
if (propertyFilter instanceof ArrayList propFilter){
this.propertyFilter = new PropertiesQuery(propFilter);
}
else if (propertyFilter instanceof String propFilter) {
this.propertyFilter = PropertiesQuery.fromString(propFilter);
this.propertyFilterAsString = propFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonView;
import com.here.xyz.XyzSerializable.Public;
import com.here.xyz.XyzSerializable.Static;
import com.here.xyz.models.geojson.exceptions.InvalidGeometryException;
import com.here.xyz.util.geo.GeometryValidator.GeometryException;
import com.here.xyz.models.geojson.implementation.Geometry;
Expand All @@ -30,13 +31,13 @@

@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class SpatialFilter {
@JsonView({Public.class})
@JsonView({Public.class, Static.class})
private Geometry geometry;

@JsonView({Public.class})
@JsonView({Public.class, Static.class})
private int radius;

@JsonView({Public.class})
@JsonView({Public.class, Static.class})
private boolean clip;

public Geometry getGeometry() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand All @@ -38,6 +39,12 @@ public class PropertiesQuery extends ArrayList<PropertyQueryList> {
"f.tags", "properties.@ns:com:here:xyz.tags"
);

public PropertiesQuery() {}

public PropertiesQuery(Collection<? extends PropertyQueryList> c) {
super(c);
}

public PropertiesQuery filterOutNamedProperty(String... propertyNames) {
if (propertyNames == null || propertyNames.length == 0) return this;
final List<String> keys = Arrays.asList(propertyNames);
Expand Down

0 comments on commit 7e98d8b

Please sign in to comment.