From 20b958301eb208fe9ed0ae8edfb14b6f3741d8f2 Mon Sep 17 00:00:00 2001 From: Cameron Mace Date: Fri, 16 Dec 2016 16:19:15 -0500 Subject: Adds checkstyle to CI (#7442) * adds checkstyle to CI * fixed gradlew path * resolved testapp checkstyle violations * added back mapboxMap variable for test * checkstyle annotations * checkstyle SDK round 1 * maps package checkstyle * rest of SDK checkstyle * checkstyle gesture library * checkstyle test * finished rest of test checkstyle * resolved all checkstyle errors * fixed class name * removed old test file * fixed camera postion test * fixed native crash --- .../com/mapbox/mapboxsdk/style/layers/Filter.java | 422 ++++++++++----------- 1 file changed, 211 insertions(+), 211 deletions(-) (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java index 6f881e4960..643a126388 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java @@ -10,221 +10,221 @@ import java.util.Collections; */ public class Filter { - /** - * Base {@link Filter} statement. Subclassed to provide concrete statements. - */ - public abstract static class Statement { - protected final String operator; - - public Statement(String operator) { - this.operator = operator; - } - - /** - * Generate a raw array representation of the filter - * - * @return the filter represented as an array - */ - public abstract Object[] toArray(); - } - - /** - * Represents a {@link Filter} statement. Can be unary (eg `has()`, etc) or take any number of values. - */ - private static class SimpleStatement extends Statement { - private final String key; - private final Object[] values; - - /** - * @param operator the operator (eg `=`, etc) - * @param key the property key - * @param values the values to operate on, if any - */ - SimpleStatement(String operator, String key, Object... values) { - super(operator); - this.key = key; - this.values = values; - } - - - /** - * {@inheritDoc} - */ - @Override - public Object[] toArray() { - ArrayList array = new ArrayList<>(2 + values.length); - array.add(operator); - array.add(key); - Collections.addAll(array, values); - return array.toArray(); - } - } - - /** - * Represents a collection of {@link Statement}s with an operator that describes their relationship - */ - private static class CompoundStatement extends Statement { - private final Statement[] statements; - - /** - * @param operator the relationship operator - * @param statements the statements to compound - */ - CompoundStatement(String operator, Statement... statements) { - super(operator); - this.statements = statements; - } - - /** - * {@inheritDoc} - */ - @Override - public Object[] toArray() { - ArrayList array = new ArrayList<>(1 + statements.length); - array.add(operator); - for (Statement statement : statements) { - array.add(statement.toArray()); - } - return array.toArray(); - } - } - - /** - * Groups a collection of statements in an 'all' relationship - * - * @param statements the collection of statements - * @return the statements compounded - */ - public static Statement all(Statement... statements) { - return new CompoundStatement("all", statements); - } - - /** - * Groups a collection of statements in an 'any' relationship - * - * @param statements the collection of statements - * @return the statements compounded - */ - public static Statement any(Statement... statements) { - return new CompoundStatement("any", statements); - } - - /** - * Groups a collection of statements in an 'none' relationship - * - * @param statements the collection of statements - * @return the statements compounded - */ - public static Statement none(Statement... statements) { - return new CompoundStatement("none", statements); - } - - /** - * Check the property's existence - * - * @param key the property key - * @return the statement - */ - public static Statement has(String key) { - return new SimpleStatement("has", key); - } + /** + * Base {@link Filter} statement. Subclassed to provide concrete statements. + */ + public abstract static class Statement { + protected final String operator; - /** - * Check the property's existence, negated - * - * @param key the property key - * @return the statement - */ - public static Statement notHas(String key) { - return new SimpleStatement("!has", key); + public Statement(String operator) { + this.operator = operator; } /** - * Check the property equals the given value + * Generate a raw array representation of the filter * - * @param key the property key - * @param value the value to check against - * @return the statement - */ - public static Statement eq(String key, Object value) { - return new SimpleStatement("==", key, value); - } - - /** - * Check the property does not equals the given value - * - * @param key the property key - * @param value the value to check against - * @return the statement - */ - public static Statement neq(String key, Object value) { - return new SimpleStatement("!=", key, value); - } - - /** - * Check the property exceeds the given value - * - * @param key the property key - * @param value the value to check against - * @return the statement - */ - public static Statement gt(String key, Object value) { - return new SimpleStatement(">", key, value); - } - - /** - * Check the property exceeds or equals the given value - * - * @param key the property key - * @param value the value to check against - * @return the statement - */ - public static Statement gte(String key, Object value) { - return new SimpleStatement(">=", key, value); - } - - /** - * Check the property does not exceeds the given value - * - * @param key the property key - * @param value the value to check against - * @return the statement - */ - public static Statement lt(String key, Object value) { - return new SimpleStatement("<", key, value); - } - - /** - * Check the property equals or does not exceeds the given value - * - * @param key the property key - * @param value the value to check against - * @return the statement - */ - public static Statement lte(String key, Object value) { - return new SimpleStatement("<=", key, value); - } - - /** - * Check the property is within the given set - * - * @param key the property key - * @param values the set of values to check against - * @return the statement - */ - public static Statement in(String key, Object... values) { - return new SimpleStatement("in", key, values); - } - - /** - * Check the property is not within the given set - * - * @param key the property key - * @param values the set of values to check against - * @return the statement - */ - public static Statement notIn(String key, Object... values) { - return new SimpleStatement("!in", key, values); - } + * @return the filter represented as an array + */ + public abstract Object[] toArray(); + } + + /** + * Represents a {@link Filter} statement. Can be unary (eg `has()`, etc) or take any number of values. + */ + private static class SimpleStatement extends Statement { + private final String key; + private final Object[] values; + + /** + * @param operator the operator (eg `=`, etc) + * @param key the property key + * @param values the values to operate on, if any + */ + SimpleStatement(String operator, String key, Object... values) { + super(operator); + this.key = key; + this.values = values; + } + + + /** + * {@inheritDoc} + */ + @Override + public Object[] toArray() { + ArrayList array = new ArrayList<>(2 + values.length); + array.add(operator); + array.add(key); + Collections.addAll(array, values); + return array.toArray(); + } + } + + /** + * Represents a collection of {@link Statement}s with an operator that describes their relationship + */ + private static class CompoundStatement extends Statement { + private final Statement[] statements; + + /** + * @param operator the relationship operator + * @param statements the statements to compound + */ + CompoundStatement(String operator, Statement... statements) { + super(operator); + this.statements = statements; + } + + /** + * {@inheritDoc} + */ + @Override + public Object[] toArray() { + ArrayList array = new ArrayList<>(1 + statements.length); + array.add(operator); + for (Statement statement : statements) { + array.add(statement.toArray()); + } + return array.toArray(); + } + } + + /** + * Groups a collection of statements in an 'all' relationship + * + * @param statements the collection of statements + * @return the statements compounded + */ + public static Statement all(Statement... statements) { + return new CompoundStatement("all", statements); + } + + /** + * Groups a collection of statements in an 'any' relationship + * + * @param statements the collection of statements + * @return the statements compounded + */ + public static Statement any(Statement... statements) { + return new CompoundStatement("any", statements); + } + + /** + * Groups a collection of statements in an 'none' relationship + * + * @param statements the collection of statements + * @return the statements compounded + */ + public static Statement none(Statement... statements) { + return new CompoundStatement("none", statements); + } + + /** + * Check the property's existence + * + * @param key the property key + * @return the statement + */ + public static Statement has(String key) { + return new SimpleStatement("has", key); + } + + /** + * Check the property's existence, negated + * + * @param key the property key + * @return the statement + */ + public static Statement notHas(String key) { + return new SimpleStatement("!has", key); + } + + /** + * Check the property equals the given value + * + * @param key the property key + * @param value the value to check against + * @return the statement + */ + public static Statement eq(String key, Object value) { + return new SimpleStatement("==", key, value); + } + + /** + * Check the property does not equals the given value + * + * @param key the property key + * @param value the value to check against + * @return the statement + */ + public static Statement neq(String key, Object value) { + return new SimpleStatement("!=", key, value); + } + + /** + * Check the property exceeds the given value + * + * @param key the property key + * @param value the value to check against + * @return the statement + */ + public static Statement gt(String key, Object value) { + return new SimpleStatement(">", key, value); + } + + /** + * Check the property exceeds or equals the given value + * + * @param key the property key + * @param value the value to check against + * @return the statement + */ + public static Statement gte(String key, Object value) { + return new SimpleStatement(">=", key, value); + } + + /** + * Check the property does not exceeds the given value + * + * @param key the property key + * @param value the value to check against + * @return the statement + */ + public static Statement lt(String key, Object value) { + return new SimpleStatement("<", key, value); + } + + /** + * Check the property equals or does not exceeds the given value + * + * @param key the property key + * @param value the value to check against + * @return the statement + */ + public static Statement lte(String key, Object value) { + return new SimpleStatement("<=", key, value); + } + + /** + * Check the property is within the given set + * + * @param key the property key + * @param values the set of values to check against + * @return the statement + */ + public static Statement in(String key, Object... values) { + return new SimpleStatement("in", key, values); + } + + /** + * Check the property is not within the given set + * + * @param key the property key + * @param values the set of values to check against + * @return the statement + */ + public static Statement notIn(String key, Object... values) { + return new SimpleStatement("!in", key, values); + } } -- cgit v1.2.1