/** * Constructor. */ DefaultPostAggregationType() { this.jsonName = EnumUtils.enumJsonName(this); }
/** * Constructs an Either containing a right value. * * @param right The right value to store in the either * @param <L> The type of the left value * @param <R> The type of the right value * * @return An Either wrapping the right value */ public static <L, R> Either<L, R> right(R right) { return new Either<>(null, right, false); }
@Override public OptionalInt getPage(Pagination<?> page) { return page.getNextPage(); } },
/** * Construct an DefaultSqlAggregationType with a keyword to look for in a * druid aggregation types, i.e. {"longSum", "doubleMin"}. * * @param sqlAggFunction The aggregation function that should be performed. * @param aliases The druid aggregation type. */ DefaultSqlAggregationType(SqlAggFunction sqlAggFunction, String... aliases) { this.sqlAggFunction = sqlAggFunction; this.validDruidAggregations = Utils.asLinkedHashSet(aliases); }
/** * Return a non delegating map which snapshots the data visible in this delegating map, disconnected from changes * to this and the underlying delegates. * * @return A non delegating plain-map copy of the data visible in this map */ public LinkedHashMap<K, V> flatView() { return entryStream() .collect(StreamUtils.toLinkedMap(Map.Entry::getKey, Map.Entry::getValue)); }
/** * Create a class scanner for provided base package. * * @param packageName The base package such as "com.yahoo.bard" * @param cacheValues Values to cache for use in object construction */ public ClassScanner(String packageName, Collection<Class> cacheValues) { this.packageName = packageName; putPrimitivesInValueCache(); putInArgumentValueCache(cacheValues); }
/** * Create a new JsonSlurper with the given sort strategy. Uses the default ToStringComparator to compare lists of * maps. * * @param sortStrategy Strategy to use when sorting the parsed JSON object */ public JsonSlurper(JsonSortStrategy sortStrategy) { this(sortStrategy, new ToStringComparator<>()); }
/** * Instantiate and run the Once each test with given threadCount. * * @param <T> TestThread subclass type * @param cls TestThread subclass * @param threadCount number of test threads to run */ static <T extends MultiThreadedTest.Once> void runTestThreadsOnce(Class<T> cls, int threadCount) { runTestThreads(cls, threadCount, 300000000000L); // Run for 300 seconds }
/** * Construct DefaultingDictionary using the given defaultValue and entries from the given defaultingDictionaryMap. * * @param defaultValue The defaultValue to be returned if a key is not present in the map * @param defaultingDictionaryMap A Map whose entries will be inserted into the DefaultingDictionary */ public DefaultingDictionary(V defaultValue, Map<K, V> defaultingDictionaryMap) { this.defaultValue = defaultValue; this.putAll(defaultingDictionaryMap); }
@Override public V get(Object key) { return getOrDefault(key, defaultValue); } }
/** * Return the union of this simplified interval list and the intervals of another. * * @param that A simplified list of intervals * * @return A new simplified list containing all subintervals of both this and that. */ public SimplifiedIntervalList union(SimplifiedIntervalList that) { return simplifyIntervals(this, that); }
@Override public OptionalInt getPage(Pagination<?> page) { return page.getLastPage(); } },
/** * Constructor. */ TopNMetricType() { this.jsonName = EnumUtils.enumJsonName(this); }
/** * Create a new JsonSlurper with the given sort strategy. Uses the default ToStringComparator to compare lists of * maps. * * @param sortStrategy Strategy to use when sorting the parsed JSON object */ public JsonSlurper(JsonSortStrategy sortStrategy) { this(sortStrategy, new ToStringComparator<>()); }
/** * Constructs an Either containing a left value. * * @param left The left value to store in the either * @param <L> The type of the left value * @param <R> The type of the right value * * @return An Either wrapping the left value */ public static <L, R> Either<L, R> left(L left) { return new Either<>(left, null, true); }
/** * Instantiate and run the Once each test with given threadCount. * * @param <T> TestThread subclass type * @param cls TestThread subclass * @param threadCount number of test threads to run */ static <T extends MultiThreadedTest.Once> void runTestThreadsOnce(Class<T> cls, int threadCount) { runTestThreads(cls, threadCount, 300000000000L); // Run for 300 seconds }
/** * Constructor. */ DefaultExtractionFunctionType() { this.jsonName = EnumUtils.enumJsonName(this); }
/** * Constructor. */ DefaultQueryType() { this.jsonName = EnumUtils.enumJsonName(this); }
/** * Constructor. */ DefaultFilterType() { this.jsonName = EnumUtils.enumJsonName(this); }
/** * Constructor. */ DefaultDimensionSpecType() { this.jsonName = EnumUtils.enumJsonName(this); }