method2testcases stringlengths 118 6.63k |
|---|
### Question:
FloatRangeBlockIndex implements IBlockIndex { @Override public int getBinarySize(){ return Float.BYTES * 2; } FloatRangeBlockIndex(); FloatRangeBlockIndex( final Float min , final Float max ); @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blockIndex ); @Override... |
### Question:
BlockIndexNode { public int getBinarySize() throws IOException{ if( isDisable ){ return 0; } int length = 0; length += Integer.BYTES; if( blockIndex != null ){ length += Integer.BYTES; length += RangeBlockIndexNameShortCut.getShortCutName( blockIndex.getClass().getName() ).getBytes( "UTF-8" ).length; leng... |
### Question:
StringRangeBlockIndex implements IBlockIndex { @Override public BlockIndexType getBlockIndexType(){ return BlockIndexType.RANGE_STRING; } StringRangeBlockIndex(); StringRangeBlockIndex( final String min , final String max ); @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBl... |
### Question:
StringRangeBlockIndex implements IBlockIndex { @Override public int getBinarySize(){ return ( min.length() * 2 ) + ( max.length() * 2 ) + 4 + 4; } StringRangeBlockIndex(); StringRangeBlockIndex( final String min , final String max ); @Override BlockIndexType getBlockIndexType(); @Override boolean merge( ... |
### Question:
ByteRangeBlockIndex implements IBlockIndex { @Override public BlockIndexType getBlockIndexType(){ return BlockIndexType.RANGE_BYTE; } ByteRangeBlockIndex(); ByteRangeBlockIndex( final byte min , final byte max ); @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blo... |
### Question:
ByteRangeBlockIndex implements IBlockIndex { @Override public int getBinarySize(){ return Byte.BYTES * 2; } ByteRangeBlockIndex(); ByteRangeBlockIndex( final byte min , final byte max ); @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blockIndex ); @Override int g... |
### Question:
UnsupportedBlockIndex implements IBlockIndex { @Override public BlockIndexType getBlockIndexType(){ return BlockIndexType.UNSUPPORTED; } @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blockIndex ); @Override int getBinarySize(); @Override byte[] toBinary(); @Over... |
### Question:
UnsupportedBlockIndex implements IBlockIndex { @Override public boolean merge( final IBlockIndex blockIndex ){ return false; } @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blockIndex ); @Override int getBinarySize(); @Override byte[] toBinary(); @Override void ... |
### Question:
UnsupportedBlockIndex implements IBlockIndex { @Override public int getBinarySize(){ return 0; } @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blockIndex ); @Override int getBinarySize(); @Override byte[] toBinary(); @Override void setFromBinary( final byte[] bu... |
### Question:
UnsupportedBlockIndex implements IBlockIndex { @Override public byte[] toBinary(){ return new byte[0]; } @Override BlockIndexType getBlockIndexType(); @Override boolean merge( final IBlockIndex blockIndex ); @Override int getBinarySize(); @Override byte[] toBinary(); @Override void setFromBinary( final b... |
### Question:
ParserWritable implements Writable { @Override public void write( final DataOutput dataOutput ) throws IOException { throw new UnsupportedOperationException("write unsupported"); } void set( final IParser parser ); @Override void write( final DataOutput dataOutput ); @Override void readFields( final Data... |
### Question:
Promise { public static Promise <List <Object>> all (Promise <?>... promises) { return all (Arrays.asList (promises)); } Promise(PromiseExecutor<T> impl); Promise(String name, PromiseExecutor<T> impl); private Promise(T value); private Promise(Throwable reason); private Promise(String name, PromiseExe... |
### Question:
Promise { public static <U> Promise <U> race (Promise <U>... promises) { return race (Arrays.asList (promises)); } Promise(PromiseExecutor<T> impl); Promise(String name, PromiseExecutor<T> impl); private Promise(T value); private Promise(Throwable reason); private Promise(String name, PromiseExecutor<... |
### Question:
Promise { public boolean cancel () { return this.cancel (true); } Promise(PromiseExecutor<T> impl); Promise(String name, PromiseExecutor<T> impl); private Promise(T value); private Promise(Throwable reason); private Promise(String name, PromiseExecutor<T> impl, Status status, T value, Throwable reason... |
### Question:
Promise { public static <T> T await (Promise <T> promise) throws Throwable { return await (promise, true); } Promise(PromiseExecutor<T> impl); Promise(String name, PromiseExecutor<T> impl); private Promise(T value); private Promise(Throwable reason); private Promise(String name, PromiseExecutor<T> imp... |
### Question:
QuadTree implements Layer, BoundingBoxChangeListener { @Override public void clear() { if (threadSafe) { synchronized (lock) { final Set<DrawingObject> dos = tree.searchItems(); for (final DrawingObject dob : dos) { dob.removeBoundingBoxChangeListener(this); } tree.clear(); insertionOrder.clear(); inserti... |
### Question:
QuadTree implements Layer, BoundingBoxChangeListener { @Override public void pushBack(final DrawingObject object) { if (threadSafe) { synchronized (lock) { insertionOrder.put(object, --insertionOrderSmallest); } } else { insertionOrder.put(object, --insertionOrderSmallest); } } @SuppressWarnings("syntheti... |
### Question:
QuadTree implements Layer, BoundingBoxChangeListener { @Override public void remove(final DrawingObject d) { if (threadSafe) { final Rectangle rect = d.getBoundingBox().rectangle; synchronized (lock) { tree.removeItem(d, rect); d.removeBoundingBoxChangeListener(this); insertionOrder.remove(d); } } else { ... |
### Question:
QuadTree implements Layer, BoundingBoxChangeListener { @Override public void bringToFront(final DrawingObject dob) { if (threadSafe) { synchronized (lock) { insertionOrder.put(dob, ++insertionOrderLargest); } } else { insertionOrder.put(dob, ++insertionOrderLargest); } } @SuppressWarnings("synthetic-acces... |
### Question:
JSONArray extends JSONGetter<Integer> implements JSON, List<Object> { @Override public boolean add(Object e) { return this.rawArrayList.add(JSONUtil.wrap(e)); } JSONArray(); JSONArray(JSONTokener x); JSONArray(String source); JSONArray(Object arrayOrCollection); boolean isNull(int index); String join(S... |
### Question:
JSONArray extends JSONGetter<Integer> implements JSON, List<Object> { @Override public Object get(int index) { return this.rawArrayList.get(index); } JSONArray(); JSONArray(JSONTokener x); JSONArray(String source); JSONArray(Object arrayOrCollection); boolean isNull(int index); String join(String separ... |
### Question:
JSONObject extends JSONGetter<String> implements JSON, Map<String, Object> { @Override public void putAll(Map<? extends String, ? extends Object> m) { rawHashMap.putAll(m); } JSONObject(); JSONObject(JSONObject jsonObject, String... names); JSONObject(JSONTokener x); JSONObject(Object source); JSONObj... |
### Question:
JSONObject extends JSONGetter<String> implements JSON, Map<String, Object> { @Override public Object get(Object key) { return rawHashMap.get(key); } JSONObject(); JSONObject(JSONObject jsonObject, String... names); JSONObject(JSONTokener x); JSONObject(Object source); JSONObject(Object pojo, String[] ... |
### Question:
JSONObject extends JSONGetter<String> implements JSON, Map<String, Object> { public <T> T toBean(Class<T> clazz) { return toBean(clazz, false); } JSONObject(); JSONObject(JSONObject jsonObject, String... names); JSONObject(JSONTokener x); JSONObject(Object source); JSONObject(Object pojo, String[] nam... |
### Question:
CassandraLoader implements Loader<DecisionTreeRuleSet>, Persister, ComponentLifecycle { public Result<ChangeSet> getChange(final String changeSetName) { try { final ResultSet resultSet = this.session.execute(CQL_GET_ACTIVE_CHANGE, changeSetName); EhSupport.ensure(!resultSet.isExhausted(), "ChangeSet %s do... |
### Question:
DecisionTreeRule implements TreeRule { public boolean isDuplicateInputData(final DecisionTreeRule other) { if (other == null || drivers.length != other.drivers.length) { return false; } for (int i = 0; i < drivers.length; i++) { final InputDriver thisValue = drivers[i]; final InputDriver otherValue = othe... |
### Question:
DecisionTreeRule implements TreeRule { public boolean isDuplicateEvaluations(final DecisionTreeRule other) { if (other == null || evaluations == null || other.evaluations == null || evaluations.length != other.evaluations.length) { return false; } for (int i = 0; i < evaluations.length; i++) { final Input... |
### Question:
DecisionTreeRule implements TreeRule { public boolean isDuplicateOutputData(final DecisionTreeRule other) { if (other == null || outputs.size() != other.outputs.size()) { return false; } for (final Map.Entry<String, String> entry : outputs.entrySet()) { final String value = other.outputs.get(entry.getKey(... |
### Question:
DecisionTreeRule implements TreeRule { public boolean isDuplicateDateRange(final DecisionTreeRule other) { return other != null && start.equals(other.start) && end.equals(other.end); } DecisionTreeRule(final UUID ruleIdentifier, final UUID ruleCode, final InputDriver[] drivers,
... |
### Question:
DecisionTreeRule implements TreeRule { public boolean isDuplicateRule(final DecisionTreeRule other) { if (other == null) { return false; } if (evaluations != null || other.evaluations != null) { return isDuplicateInputData(other) && isDuplicateOutputData(other) && isDuplicateDateRange(other) && isDuplicat... |
### Question:
DecisionTreeRule implements TreeRule { void replaceDriversFromCache(final DriverCache cache) { for (int i = 0; i < drivers.length; i++) { final InputDriver driver = drivers[i]; InputDriver cachedDriver = cache.get(driver.getValue(), driver.getType()); if (cachedDriver == null) { cache.put(driver); cachedD... |
### Question:
DecisionTreeRuleSet { @Override public int hashCode() { return name.hashCode(); } DecisionTreeRuleSet(final String name, final Map<UUID, DecisionTreeRule> rules,
final List<String> driverNames); DecisionTreeRuleSet(final String name, final Map<UUID, DecisionTreeRule> rules,
... |
### Question:
DecisionTreeRuleSet { public static List<WeightedDriver> convertNamesToWeightedDrivers(final List<String> driverNames) { EhSupport.ensureArg(driverNames.size() < 32, "Maximum number of drivers is 31"); return IntStream.range(0, driverNames.size()) .mapToObj(counter -> new WeightedDriver(driverNames.get(co... |
### Question:
DecisionTreeRuleSet { public Set<ValueGroup> getValueGroups() { return groups.values().stream() .collect(collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet)); } DecisionTreeRuleSet(final String name, final Map<UUID, DecisionTreeRule> rules,
final List<String> driver... |
### Question:
DecisionTreeRuleSet { public List<String> getDriverNames() { return driverNames.stream().map(WeightedDriver::getName) .collect(collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); } DecisionTreeRuleSet(final String name, final Map<UUID, DecisionTreeRule> rules,
f... |
### Question:
Change implements TreeChange { public boolean addRuleChange(final RuleChange change) { EhSupport.ensureArg(change != null, "Cannot add a null rule change"); return this.ruleChanges.add(change); } Change(final UUID id,
final String ruleSetName,
final Instant activationTi... |
### Question:
DecisionTreeRuleSet { public List<String> getEvaluationNames() { return Collections.unmodifiableList(evaluationNames); } DecisionTreeRuleSet(final String name, final Map<UUID, DecisionTreeRule> rules,
final List<String> driverNames); DecisionTreeRuleSet(final String name, final M... |
### Question:
DecisionTreeRuleSet { public List<InputDriver> getDriversByType(final InputValueType type) { return cache.findByInputDriverType(type); } DecisionTreeRuleSet(final String name, final Map<UUID, DecisionTreeRule> rules,
final List<String> driverNames); DecisionTreeRuleSet(final Stri... |
### Question:
ValueGroup implements TreeValueGroup { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } final ValueGroup otherGroup = (ValueGroup) other; return getId().equals(otherGroup.getId()) && getNam... |
### Question:
ValueGroup implements TreeValueGroup { @Override public int hashCode() { return getId().hashCode() + getName().hashCode() + getValues().hashCode() + getRange().hashCode(); } ValueGroup(final String name, final List<String> values); ValueGroup(final UUID id, final String name, final List<String> values, f... |
### Question:
ValueGroup implements TreeValueGroup { @Override public String toString() { return GroupDriver.VG_PREFIX + getId(); } ValueGroup(final String name, final List<String> values); ValueGroup(final UUID id, final String name, final List<String> values, final DateRange range); @Override UUID getId(); @Override... |
### Question:
Change implements TreeChange { public boolean removeRuleChange(final RuleChange change) { return this.ruleChanges.remove(change); } Change(final UUID id,
final String ruleSetName,
final Instant activationTime,
final DateRange changeRange,
... |
### Question:
InputBuilder { public static String regExInput(final String regex) { return RegexDriver.REGEX_PREFIX + ":" + regex; } private InputBuilder(); static String regExInput(final String regex); static String dateRangeInput(final Range<Instant> range); static String integerRangeInput(final Range<Integer> range)... |
### Question:
InputBuilder { public static String dateRangeInput(final Range<Instant> range) { return DateRangeDriver.DR_PREFIX + ":" + range.getStart() + "|" + range.getFinish(); } private InputBuilder(); static String regExInput(final String regex); static String dateRangeInput(final Range<Instant> range); static St... |
### Question:
InputBuilder { public static String integerRangeInput(final Range<Integer> range) { return IntegerRangeDriver.IR_PREFIX + ":" + range.getStart() + "|" + range.getFinish(); } private InputBuilder(); static String regExInput(final String regex); static String dateRangeInput(final Range<Instant> range); sta... |
### Question:
Change implements TreeChange { public boolean addValueGroupChange(final ValueGroupChange change) { EhSupport.ensureArg(change != null, "Cannot add a null value group change"); return this.valueGroupChanges.add(change); } Change(final UUID id,
final String ruleSetName,
f... |
### Question:
DomainSerialiser { public static List<String> convertOutputs(final Map<String, String> outputMap) { return outputMap.entrySet().stream().map( entry -> entry.getKey() + ":" + entry.getValue()).collect(Collectors.toList()); } private DomainSerialiser(); static List<String> convertDrivers(final InputDriver[... |
### Question:
Change implements TreeChange { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } final Change otherChange = (Change) other; return this.id.equals(otherChange.getId()) && this.ruleSetName.equ... |
### Question:
DecisionTree { public static DecisionTree instanceOf(final Loader<DecisionTreeRuleSet> loader, final DecisionTreeType type) { final ActionRetrier<DecisionTreeRuleSet> retrier = Retrier.createNonRetrier(); final Result<DecisionTreeRuleSet> result = retrier.run(loader, booleanResult -> false); EhSupport.che... |
### Question:
Change implements TreeChange { @Override public int hashCode() { return this.id.hashCode() + this.ruleSetName.hashCode(); } Change(final UUID id,
final String ruleSetName,
final Instant activationTime,
final DateRange changeRange,
fin... |
### Question:
ValueGroupChange { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } final ValueGroupChange change = (ValueGroupChange) other; return this.type == change.getType() && this.valueGroup.equals(... |
### Question:
ValueGroupChange { @Override public int hashCode() { return this.type.hashCode() + this.valueGroup.hashCode(); } ValueGroupChange(final Type type, final ValueGroup valueGroup); Type getType(); ValueGroup getValueGroup(); @Override boolean equals(final Object other); @Override int hashCode(); }### Answer:... |
### Question:
RuleChange { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } final RuleChange otherChange = (RuleChange) other; return this.type == otherChange.getType() && this.getRule().equals(otherChan... |
### Question:
RuleChange { @Override public int hashCode() { return this.type.hashCode() + this.rule.hashCode(); } RuleChange(final Type type, final DecisionTreeRule rule); Type getType(); DecisionTreeRule getRule(); @Override boolean equals(final Object other); @Override int hashCode(); }### Answer:
@Test public void... |
### Question:
JsonJacksonParser implements RuleBuilderParser { @Override public DecisionTreeRuleSet parseRuleSet(final InputStream inputStream) { return EhSupport.propagateFn(() -> { try (final JsonParser parser = new JsonFactory().createParser(inputStream)) { EhSupport.ensureArg(parser.nextToken() == JsonToken.START_O... |
### Question:
RuleChangeBuilder extends DomainBuilder<RuleChange, DecisionTreeRule> { public static Builder<RuleChangeBuilder, List<RuleChange>> creator(final UUID ruleCode) { return Builder.instanceOf(RuleChangeBuilder.create(ruleCode), RuleChangeBuilder.validate(), RuleChangeBuilder::builds); } private RuleChangeBui... |
### Question:
RollbackChangeBuilder { public static Builder<RollbackChangeBuilder, Change> creator() { return Builder.instanceOf(RollbackChangeBuilder.create(), RollbackChangeBuilder.validate(), RollbackChangeBuilder::builds); } static Builder<RollbackChangeBuilder, Change> creator(); RollbackChangeBuilder change(fina... |
### Question:
ValueGroupChangeBuilder extends DomainBuilder<ValueGroupChange, ValueGroup> { public static Builder<ValueGroupChangeBuilder, List<ValueGroupChange>> creator(final String valueGroupName) { return Builder.instanceOf(ValueGroupChangeBuilder.create(valueGroupName), ValueGroupChangeBuilder::builds); } private ... |
### Question:
ValueGroupChangeBuilder extends DomainBuilder<ValueGroupChange, ValueGroup> { private ValueGroup getValueGroup(final ValueGroupChangeBuilder builder, final UUID id, final String name, final List<String> values, final DateRange range) { final ValueGroup group = new ValueGroup(id, name, values, range); if (... |
### Question:
Audit { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } final Audit audit = (Audit) other; return Objects.equals(this.initiator, audit.getInitiator()) && Objects.equals(this.initiatorTime,... |
### Question:
Audit { @Override public int hashCode() { return Objects.hashCode(this.initiator) + Objects.hashCode(this.initiatorTime) + Objects.hashCode(this.authoriser) + Objects.hashCode(this.authoriserTime); } Audit(final String initiator,
final Instant initiatorTime,
final String ... |
### Question:
ChangeApplier { public static void apply(final DecisionTreeRuleSet ruleSet, final Change change) { ruleSet.updateRules(change); } private ChangeApplier(); static void apply(final DecisionTreeRuleSet ruleSet, final Change change); }### Answer:
@Test public void testAppliesChangeToRuleSet() { final Decisi... |
### Question:
ChangeableDecisionTree extends DecisionTree { public static ChangeableDecisionTree instanceOf(final Loader<DecisionTreeRuleSet> loader, final DecisionTreeType type, final Persister persister) { final ActionRetrier<DecisionTreeRuleSet> retrier = Retrier.createNonRetrier(); final Result<DecisionTreeRuleSet>... |
### Question:
Evaluator { public static List<EvaluationResult> evaluateAllResultsWithWildcards(final List<String> searchInputs, final Instant time, final TreeNode rootNode) { final List<TreeNode> nextNodes = rootNode.getEvaluatedNodesWithWildcards(searchInputs, time); final List<EvaluationResult> results = new ArrayLis... |
### Question:
StreamLoader implements Loader<DecisionTreeRuleSet>, AutoCloseable { public static StreamLoader jsonLoader(final InputStream json, final RuleBuilderParser parser) { return new StreamLoader(json, parser); } private StreamLoader(final InputStream stream, final RuleBuilderParser parser); static StreamLoader... |
### Question:
ChangeSet { public boolean addChange(final Change change) { EhSupport.ensureArg(change != null, "Cannot add a null change"); return this.changes.add(change); } ChangeSet(final UUID id, final String name, final Set<Change> changes); UUID getId(); String getName(); Set<Change> getChanges(); boolean addChang... |
### Question:
OutputResults { public Map<String, String> results() { return this.rule.getOutputs(); } OutputResults(final DecisionTreeRule rule); Map<String, String> results(); }### Answer:
@Test public void testConstruction() { final Map<String, String> outputDriver = Collections.singletonMap("outputDriver", "result"... |
### Question:
GroupEvaluation implements Predicate<String> { @Override public boolean test(final String input) { if (this.group.contains(input)) { return true; } for (final InputDriver driver : this.drivers) { if (driver.evaluate(input)) { return true; } } return false; } GroupEvaluation(final String value, final List<... |
### Question:
GroupEvaluation implements Predicate<String> { @Override public int hashCode() { return this.value.hashCode(); } GroupEvaluation(final String value, final List<InputDriver> inputDrivers); void setSubValues(final List<InputDriver> inputDrivers); @Override boolean test(final String input); @Override boolean... |
### Question:
GroupEvaluation implements Predicate<String> { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } return this.value.equals(((GroupEvaluation) other).value); } GroupEvaluation(final String value, f... |
### Question:
TimeSlicedRootNode implements TreeNode { Optional<DecisionTreeRuleSet> getSlicedRuleSet(final Instant time) { final Map<UUID, DecisionTreeRule> ruleMap = new HashMap<>(); final Optional<Range<Instant>> activeRange = getActiveRange(time); if (activeRange.isPresent()) { ruleSet.getRules().forEach((ruleId, r... |
### Question:
TimeSlicedRootNode implements TreeNode { @Override public List<TreeNode> getEvaluatedNodes(final List<String> inputs, final Instant time) { EhSupport.ensureArg(time != null, "Time sliced decision tree has %s time", time); final Optional<TreeNode> rootSlicedNode = getTreeNodeForTime(time); EhSupport.ensure... |
### Question:
ResultNode extends BaseTreeNode implements EvaluationResult, TreeNode { @Override public boolean equals(final Object other) { return false; } ResultNode(final InputDriver driver,
final int driverLevel,
final DecisionTreeRule rule,
final TreeNode delegate); @Ove... |
### Question:
ResultNode extends BaseTreeNode implements EvaluationResult, TreeNode { @Override public int hashCode() { return super.hashCode() + Objects.hashCode(this.range); } ResultNode(final InputDriver driver,
final int driverLevel,
final DecisionTreeRule rule,
final Tr... |
### Question:
DatedTreeNode extends BaseTreeNode { @Override public boolean equals(final Object obj) { if (!(super.equals(obj))) { return false; } final Range<Instant> other = ((BaseTreeNode) obj).getDateRange(); return Objects.equals(this.range, other) || inRange(other.getStart(), this.range) || inRange(other.getFinis... |
### Question:
DatedTreeNode extends BaseTreeNode { @Override public int hashCode() { return super.hashCode() + this.range.hashCode(); } DatedTreeNode(final InputDriver driver, final int level, final Range<Instant> dateRange); @Override boolean equals(final Object obj); @Override int hashCode(); @Override Range<Instant>... |
### Question:
StringEvaluation implements Predicate<String> { @Override public int hashCode() { return this.value.hashCode(); } StringEvaluation(final String value); @Override boolean test(final String input); @Override boolean equals(final Object other); @Override int hashCode(); }### Answer:
@Test public void hashCo... |
### Question:
StringEvaluation implements Predicate<String> { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } return this.value.equals(((StringEvaluation) other).value); } StringEvaluation(final String value... |
### Question:
DatedNodeKey { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } final DatedNodeKey otherKey = (DatedNodeKey) other; return Objects.equals(getValue(), otherKey.getValue()) && Objects.equals(... |
### Question:
DatedNodeKey { @Override public int hashCode() { return getValue().hashCode() + getRange().hashCode(); } DatedNodeKey(final String value, final Range<Instant> range); Range<Instant> getRange(); String getValue(); @Override boolean equals(final Object other); @Override int hashCode(); }### Answer:
@Test p... |
### Question:
GroupDriver extends InputDriver { @Override public int hashCode() { return super.hashCode(); } GroupDriver(final String value, final List<InputDriver> inputDrivers); static void convertDriversIntoDriversAndGroups(final List<InputDriver> originalDrivers,
... |
### Question:
GroupDriver extends InputDriver { static List<InputDriver> getSubInputDrivers(final List<InputDriver> originalDrivers, final boolean recurse) { final Set<InputDriver> allDrivers = new HashSet<>(originalDrivers); for (final InputDriver driver : originalDrivers) { if (recurse && InputValueType.VALUE_GROUP.e... |
### Question:
GroupDriver extends InputDriver { public InputDriver[] getSubDrivers(final boolean recurse) { final List<InputDriver> allDrivers = getSubInputDrivers(this.originalDrivers, recurse); return allDrivers.toArray(new InputDriver[allDrivers.size()]); } GroupDriver(final String value, final List<InputDriver> inp... |
### Question:
ChangeSet { public boolean removeChange(final Change change) { return this.changes.remove(change); } ChangeSet(final UUID id, final String name, final Set<Change> changes); UUID getId(); String getName(); Set<Change> getChanges(); boolean addChange(final Change change); boolean removeChange(final Change c... |
### Question:
GroupDriver extends InputDriver { @Override public boolean equals(final Object other) { return super.equals(other); } GroupDriver(final String value, final List<InputDriver> inputDrivers); static void convertDriversIntoDriversAndGroups(final List<InputDriver> originalDrivers,
... |
### Question:
RegExEvaluation implements Predicate<String> { @Override public boolean test(final String input) { return this.pattern.matcher(input).matches(); } RegExEvaluation(final String value); @Override boolean test(final String input); @Override boolean equals(final Object other); @Override int hashCode(); }### ... |
### Question:
RegExEvaluation implements Predicate<String> { @Override public int hashCode() { return this.pattern.toString().hashCode(); } RegExEvaluation(final String value); @Override boolean test(final String input); @Override boolean equals(final Object other); @Override int hashCode(); }### Answer:
@Test public ... |
### Question:
RegExEvaluation implements Predicate<String> { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } return this.pattern.toString().equals(((RegExEvaluation) other).pattern.toString()); } RegExEvalua... |
### Question:
WeightedDriver implements Comparable<WeightedDriver> { public String getName() { return this.name; } WeightedDriver(final String name, final int weight); String getName(); int getWeight(); @Override int compareTo(final WeightedDriver other); @Override boolean equals(final Object other); @Override int hash... |
### Question:
DecisionTreeRule implements TreeRule { public boolean isActiveAt(final Instant time) { return time.isAfter(this.start) && time.isBefore(this.end); } DecisionTreeRule(final UUID ruleIdentifier, final UUID ruleCode, final InputDriver[] drivers,
final InputDriver[] evaluations, fi... |
### Question:
DecisionTreeRule implements TreeRule { public long getRuleWeight() { long weight = 0; long weightedLevel = INITIAL_WEIGHTED_VALUE; for (int i = drivers.length - 1; i >= 0; i--) { if (!InputValueType.WILDCARD.equals(drivers[i].getValue())) { weight += weightedLevel; } weightedLevel = weightedLevel * 2; } r... |
### Question:
DecisionTreeRule implements TreeRule { @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } final DecisionTreeRule otherRule = (DecisionTreeRule) other; return ruleIdentifier.equals(otherRule.ruleId... |
### Question:
DecisionTreeRule implements TreeRule { @Override public int hashCode() { return ruleIdentifier.hashCode(); } DecisionTreeRule(final UUID ruleIdentifier, final UUID ruleCode, final InputDriver[] drivers,
final InputDriver[] evaluations, final Map<String, String> outputs,
... |
### Question:
UserLookUp { public boolean checkUsernameUniqueness( String username, boolean isEncrypted, RequestContext context) { List<Map<String, Object>> userMapList = getRecordByType(JsonKey.USER_LOOKUP_FILED_USER_NAME, username, !isEncrypted, context); if (CollectionUtils.isNotEmpty(userMapList)) { return false; }... |
### Question:
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> delete(String index, String identifier, RequestContext context) { long startTime = System.currentTimeMillis(); logger.info(context, "ElasticSearchRestHighImpl:delete: method started at ==" + startTime); Promise<Bo... |
### Question:
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert( String index, List<Map<String, Object>> dataList, RequestContext context) { long startTime = System.currentTimeMillis(); logger.info( context, "ElasticSearchRestHighImpl:bulkInsert: method started at =... |
### Question:
MigrationUtils { public static ShadowUser getRecordByUserId(String userId, RequestContext context) { ShadowUser shadowUser = null; Response response = cassandraOperation.searchValueInList( JsonKey.SUNBIRD, JsonKey.SHADOW_USER, JsonKey.USERIDS, userId, context); if (!((List) response.getResult().get(JsonKe... |
### Question:
ElasticSearchMapping { public static String createMapping() { String mapping = " { \"dynamic_templates\": [ {\"longs\": {\"match_mapping_type\": \"long\", \"mapping\": {\"type\": \"long\", \"fields\": { \"raw\": {\"type\": \"long\" } }}}},{\"booleans\": {\"match_mapping_type\": \"boolean\", \"mapping\": {... |
### Question:
ElasticSearchSettings { public static String createSettingsForIndex() { String settings = "{\"analysis\": {\"analyzer\": {\"cs_index_analyzer\": {\"type\": \"custom\",\"tokenizer\": \"standard\",\"filter\": [\"lowercase\",\"mynGram\"]},\"cs_search_analyzer\": {\"type\": \"custom\",\"tokenizer\": \"standar... |
### Question:
TelemetryGenerator { public static String audit(Map<String, Object> context, Map<String, Object> params) { if (!validateRequest(context, params)) { return ""; } String actorId = (String) context.get(JsonKey.ACTOR_ID); String actorType = (String) context.get(JsonKey.ACTOR_TYPE); Actor actor = new Actor(act... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.