method2testcases stringlengths 118 3.08k |
|---|
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void setSamplerConfiguration(SamplerConfiguration samplerConfiguration) { scanner.setSamplerConfiguration(samplerConfiguration); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThread... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public SamplerConfiguration getSamplerConfiguration() { return scanner.getSamplerConfiguration(); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void clearSamplerConfiguration() { scanner.clearSamplerConfiguration(); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionKeyCont... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void setBatchTimeout(long l, TimeUnit timeUnit) { scanner.setBatchTimeout(l, timeUnit); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
E... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public long getBatchTimeout(TimeUnit timeUnit) { return scanner.getBatchTimeout(timeUnit); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
Encry... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void setClassLoaderContext(String s) { scanner.setClassLoaderContext(s); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionKeyCon... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void clearClassLoaderContext() { scanner.clearClassLoaderContext(); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionKeyContaine... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public String getClassLoaderContext() { return scanner.getClassLoaderContext(); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionKeyCon... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void addScanIterator(IteratorSetting iteratorSetting) { scanner.addScanIterator(iteratorSetting); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfi... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void removeScanIterator(String s) { scanner.removeScanIterator(s); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionKeyContainer... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void updateScanIteratorOption(String s, String s1, String s2) { scanner.updateScanIteratorOption(s, s1, s2); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig ... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public void setTimeout(long l, TimeUnit timeUnit) { scanner.setTimeout(l, timeUnit); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionK... |
### Question:
EncryptedBatchScanner implements BatchScanner { @Override public long getTimeout(TimeUnit timeUnit) { return scanner.getTimeout(timeUnit); } EncryptedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, EncryptionConfig cryptoConfig,
EncryptionKeyCo... |
### Question:
EncryptedBatchWriter implements BatchWriter { @Override public void addMutations(Iterable<Mutation> iterable) throws MutationsRejectedException { for (Mutation mutation : iterable) { addMutation(mutation); } } EncryptedBatchWriter(Connector connector, String tableName, BatchWriterConfig batchConfig, Encry... |
### Question:
EncryptedBatchWriter implements BatchWriter { @Override public void flush() throws MutationsRejectedException { writer.flush(); } EncryptedBatchWriter(Connector connector, String tableName, BatchWriterConfig batchConfig, EncryptionConfig cryptoConfig, EncryptionKeyContainer keys); @Override void addMutati... |
### Question:
EncryptedBatchWriter implements BatchWriter { @Override public void close() throws MutationsRejectedException { writer.close(); } EncryptedBatchWriter(Connector connector, String tableName, BatchWriterConfig batchConfig, EncryptionConfig cryptoConfig, EncryptionKeyContainer keys); @Override void addMutati... |
### Question:
EncryptionConfig { public void write(Writer out) throws IOException { Ini configIni = new Ini(); for (FieldEncryptorConfig config : fieldEncryptorConfigs) { config.write(configIni); } configIni.store(out); } EncryptionConfig(List<FieldEncryptorConfig> fieldEncryptorConfigs); void write(Writer out); }### ... |
### Question:
EncryptedScannerIterator implements ItemProcessingIterator<Entry<Key,Value>> { @Override public boolean hasNext() { if (next == null) { advance(); } return next != null; } EncryptedScannerIterator(Iterator<Entry<Key,Value>> iterator, EntryEncryptor encryptor, List<Range> clientSideRanges,
SortedSet<... |
### Question:
EncryptedScannerIterator implements ItemProcessingIterator<Entry<Key,Value>> { @Override public Entry<Key,Value> next() { if (next == null) { advance(); } if (next == null) { throw new NoSuchElementException(); } Entry<Key,Value> value = next; next = null; return value; } EncryptedScannerIterator(Iterator... |
### Question:
EncryptedScannerIterator implements ItemProcessingIterator<Entry<Key,Value>> { @Override public Entry<Key,Value> unprocessed() { if (next != null || unprocessedEntry == null) { throw new NoSuchElementException(); } return unprocessedEntry; } EncryptedScannerIterator(Iterator<Entry<Key,Value>> iterator, En... |
### Question:
EncryptedScannerIterator implements ItemProcessingIterator<Entry<Key,Value>> { @Override public void remove() { throw new UnsupportedOperationException(); } EncryptedScannerIterator(Iterator<Entry<Key,Value>> iterator, EntryEncryptor encryptor, List<Range> clientSideRanges,
SortedSet<Column> clientS... |
### Question:
EntryEncryptor { public boolean canBeDeleteServerSide() { for (EntryField field : FieldEncryptorConfig.KEY_DESTINATION_FIELDS) { if (destinationMap.containsKey(field) && !destinationMap.get(field).canBeFilteredServerSide(FieldEncryptorConfig.KEY_SOURCE_FIELDS)) { return false; } } return true; } EntryEncr... |
### Question:
FieldEncryptor { boolean canBeFilteredServerSide(Collection<EntryField> availableSources) { return config.valueEncryptor.isDeterministic() && availableSources.containsAll(config.sources); } FieldEncryptor(FieldEncryptorConfig config, EncryptionKeyContainer keys); }### Answer:
@Test public void canBeFilt... |
### Question:
FieldEncryptor { boolean canSearchFor(Set<EntryField> fields) { return config.valueEncryptor.isDeterministic() && fields.equals(config.sources); } FieldEncryptor(FieldEncryptorConfig config, EncryptionKeyContainer keys); }### Answer:
@Test public void canSearchForTest() throws Exception { assertThat("no... |
### Question:
FieldEncryptor { List<byte[]> getServerSideFilterValues(MutableEntry key) { return getServerSideFilterValues(key, false); } FieldEncryptor(FieldEncryptorConfig config, EncryptionKeyContainer keys); }### Answer:
@Test public void getServerSideFilterValuesTest() throws Exception { MutableEntry original = ... |
### Question:
MutableEntry implements Cloneable { public Key toKey() { return new Key(row, colF, colQ, colVis, timestamp, delete, false); } MutableEntry(); MutableEntry(Key key); MutableEntry(Map.Entry<Key,Value> entry); MutableEntry(byte[] row, ColumnUpdate update); Key toKey(); Map.Entry<Key,Value> toEntry(); Muta... |
### Question:
MutableEntry implements Cloneable { public Map.Entry<Key,Value> toEntry() { return new AbstractMap.SimpleImmutableEntry<>(toKey(), new Value(value, false)); } MutableEntry(); MutableEntry(Key key); MutableEntry(Map.Entry<Key,Value> entry); MutableEntry(byte[] row, ColumnUpdate update); Key toKey(); Map... |
### Question:
MutableEntry implements Cloneable { public byte[] getBytes(EntryField field) { switch (field) { case ROW: return row; case COLUMN_FAMILY: return colF; case COLUMN_QUALIFIER: return colQ; case COLUMN_VISIBILITY: return colVis; case VALUE: return value; default: throw new IllegalArgumentException("invalid f... |
### Question:
MutableEntry implements Cloneable { public void setBytes(EntryField field, byte[] bytes) { switch (field) { case ROW: row = bytes; break; case COLUMN_FAMILY: colF = bytes; break; case COLUMN_QUALIFIER: colQ = bytes; break; case COLUMN_VISIBILITY: colVis = bytes; break; case VALUE: value = bytes; break; de... |
### Question:
Utils { public static byte[] xor(byte[] first, byte[] second) { checkArgument(first != null, "first is null"); checkArgument(second != null, "second is null"); checkArgument(first.length == second.length, "first and second must be the same length"); for (int i = 0; i < first.length; i++) { first[i] = (byt... |
### Question:
SignatureConfig { public ValueSigner getAlgorithm() { return this.algorithm; } SignatureConfig(ValueSigner signer, String provider, Destination destination, String destinationTable, byte[] defaultVisibility); void write(Writer out); boolean isSignatureInSeparateTable(); ValueSigner getAlgorithm(); }### A... |
### Question:
SignatureConfig { public boolean isSignatureInSeparateTable() { return this.destination == Destination.SEPARATE_TABLE; } SignatureConfig(ValueSigner signer, String provider, Destination destination, String destinationTable, byte[] defaultVisibility); void write(Writer out); boolean isSignatureInSeparateTa... |
### Question:
SignedBatchScanner implements BatchScanner { @Override public Authorizations getAuthorizations() { return valueScanner.getAuthorizations(); } SignedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, SignatureConfig signatureConfig,
SignatureKeyCon... |
### Question:
SignedBatchScanner implements BatchScanner { @Override public SamplerConfiguration getSamplerConfiguration() { return valueScanner.getSamplerConfiguration(); } SignedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, SignatureConfig signatureConfig,
... |
### Question:
SignedBatchScanner implements BatchScanner { @Override public long getBatchTimeout(TimeUnit timeUnit) { return valueScanner.getBatchTimeout(timeUnit); } SignedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, SignatureConfig signatureConfig,
Sign... |
### Question:
SignedBatchScanner implements BatchScanner { @Override public String getClassLoaderContext() { return valueScanner.getClassLoaderContext(); } SignedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, SignatureConfig signatureConfig,
SignatureKeyCon... |
### Question:
SignedBatchScanner implements BatchScanner { @Override public long getTimeout(TimeUnit timeUnit) { return valueScanner.getTimeout(timeUnit); } SignedBatchScanner(Connector connector, String tableName, Authorizations authorizations, int numQueryThreads, SignatureConfig signatureConfig,
SignatureKeyCo... |
### Question:
AnnotationFinder { public static <T extends Annotation> T annotationFor(Package aPkg, Class< ? extends T> whichAnnotation) { T annotation = null; if ((annotation = aPkg.getAnnotation(whichAnnotation)) == null) { annotation = find(aPkg, whichAnnotation); } return annotation; } static T annotationFor(Packa... |
### Question:
SimpleTypeNodeHandler extends NodeHandler<SimpleTypeNode<?>> { @Override public boolean handleSafely(SimpleTypeNode<?> node, YamlEmitter emitter) throws IOException { emitter.writeValue(node); return true; } SimpleTypeNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(Simp... |
### Question:
DefaultNodeHandler extends NodeHandler<Node> { @Override public boolean handles(Node node) { return true; } @Override boolean handles(Node node); @Override boolean handleSafely(Node node, YamlEmitter emitter); }### Answer:
@Test public void handles() throws Exception { DefaultNodeHandler handler = new D... |
### Question:
DefaultNodeHandler extends NodeHandler<Node> { @Override public boolean handleSafely(Node node, YamlEmitter emitter) { System.err.println("not handled: " + node.getClass() + ", " + Arrays.asList(node.getClass().getInterfaces())); return true; } @Override boolean handles(Node node); @Override boolean hand... |
### Question:
YamlEmitter { public void writeValue(SimpleTypeNode<?> node) throws IOException { if (node instanceof StringNode) { writeQuoted(node.getLiteralValue()); } else { writeNaked(node.getLiteralValue()); } } YamlEmitter(); YamlEmitter(Writer writer, int i); YamlEmitter indent(); YamlEmitter bulletListArray(); ... |
### Question:
AllResourceSelector implements Selector<Resource> { @Override public FluentIterable<Resource> fromApi(Api api) { List<Resource> topResources = api.resources(); FluentIterable<Resource> fi = from(topResources); for (Resource resource : topResources) { fi = fi.append(fromResource(resource)); } return fi; } ... |
### Question:
AllResourceSelector implements Selector<Resource> { @Override public FluentIterable<Resource> fromResource(Resource topResource) { List<Resource> resources = topResource.resources(); FluentIterable<Resource> fi = from(resources); for (Resource resource : resources) { fi = fi.append(fromResource(resource))... |
### Question:
ApiQueryBaseHandler implements QueryBase { @Override public <B> FluentIterable<B> queryFor(Selector<B> selector) { return selector.fromApi(api); } ApiQueryBaseHandler(Api api); @Override FluentIterable<B> queryFor(Selector<B> selector); }### Answer:
@Test public void queryFor() throws Exception { when(se... |
### Question:
ResourceQueryBaseHandler implements QueryBase { @Override public <B> FluentIterable<B> queryFor(Selector<B> selector) { return selector.fromResource(resource); } ResourceQueryBaseHandler(Resource resource); @Override FluentIterable<B> queryFor(Selector<B> selector); }### Answer:
@Test public void queryFo... |
### Question:
TopResourceSelector implements Selector<Resource> { @Override public FluentIterable<Resource> fromApi(Api api) { return from(api.resources()); } @Override FluentIterable<Resource> fromApi(Api api); @Override FluentIterable<Resource> fromResource(Resource resource); }### Answer:
@Test public void fromApi... |
### Question:
TopResourceSelector implements Selector<Resource> { @Override public FluentIterable<Resource> fromResource(Resource resource) { return FluentIterable.from(resource.resources()); } @Override FluentIterable<Resource> fromApi(Api api); @Override FluentIterable<Resource> fromResource(Resource resource); }##... |
### Question:
Query { public<T> FluentIterable<T> select(Selector<T> selector) { return queryBase.queryFor(selector); } Query(QueryBase queryBase); static Query from(Api api); static Query from(Resource resource); FluentIterable<T> select(Selector<T> selector); }### Answer:
@Test public void select() throws Exception ... |
### Question:
ResultingPojos { public void createAllTypes(String rootDirectory) throws IOException { generationContext.createSupportTypes(rootDirectory); for (CreationResult result : results) { result.createType(rootDirectory); } generationContext.createTypes(rootDirectory); } ResultingPojos(GenerationContextImpl gener... |
### Question:
ResultingPojos { public void createFoundTypes(String rootDirectory) throws IOException { generationContext.createSupportTypes(rootDirectory); for (CreationResult result : results) { result.createType(rootDirectory); } } ResultingPojos(GenerationContextImpl generationContext); void addNewResult(CreationRes... |
### Question:
CreationResult { public void createType(String rootDirectory) throws IOException { if ( interf.typeSpecs.size() == 0 ) { createInlineType(this); } createJavaFile(packageName, interf, rootDirectory, true); if ( implementationName != null ) { createJavaFile(packageName, impl, rootDirectory, false); } } Crea... |
### Question:
PojoToRamlImpl implements PojoToRaml { @Override public Result classToRaml(final Class<?> clazz) { RamlType type = RamlTypeFactory.forType(clazz, classParserFactory.createParser(clazz), adjusterFactory).or(new RamlTypeSupplier(clazz)); if ( type.isScalar()) { return new Result(null, Collections.<String, T... |
### Question:
RenamePlugin extends AllTypesPluginHelper { @Override public ClassName className(ObjectPluginContext objectPluginContext, ObjectTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return changeName(currentSuggestion, eventType); } RenamePlugin(List<String> arguments); @Override C... |
### Question:
BoxWhenNotRequired implements ReferenceTypeHandlerPlugin { @Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } BoxWhenNo... |
### Question:
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public ClassName className(UnionPluginContext unionPluginContext, UnionTypeDeclaration ramlType, ClassName currentSuggestion, EventType eventType) { return currentSuggestion; } @Override ClassName className(UnionPluginContext unionPluginCon... |
### Question:
JaxbUnionExtension implements UnionTypeHandlerPlugin { @Override public FieldSpec.Builder anyFieldCreated(UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { AnnotationSpec.Builder elementsAnnotation = AnnotationSpec.builder(... |
### Question:
PojoToRamlImpl implements PojoToRaml { @Override public TypeBuilder name(Class<?> clazz) { RamlAdjuster adjuster = this.adjusterFactory.createAdjuster(clazz); ClassParser parser = classParserFactory.createParser(clazz); RamlType type = RamlTypeFactory.forType(clazz, parser, adjusterFactory).or(new RamlTyp... |
### Question:
Jsr303Extension extends AllTypesPluginHelper { @Override public FieldSpec.Builder anyFieldCreated( UnionPluginContext context, UnionTypeDeclaration union, TypeSpec.Builder typeSpec, FieldSpec.Builder anyType, EventType eventType) { FacetValidation.addFacetsForBuilt(new AnnotationAdder() { @Override public... |
### Question:
TypeFetchers { public static TypeFetcher fromTypes() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(api.types())) .firstMa... |
### Question:
TypeFetchers { public static TypeFetcher fromAnywhere() { return new TypeFetcher() { Iterable<TypeDeclaration> foundInApi; @Override public TypeDeclaration fetchType(Api api, final String name) throws GenerationException { return FluentIterable.from(Optional.fromNullable(foundInApi).or(FluentIterable.from... |
### Question:
TypeFinders { public static TypeFinder inTypes() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return api.types(); } }; } static TypeFinder inTypes(); static TypeFinder inLibraries(); static TypeFinder everyWhere(); static TypeFinder inResources(); }### Answ... |
### Question:
TypeFinders { public static TypeFinder inLibraries() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { List<TypeDeclaration> foundTypes = new ArrayList<>(); Utils.goThroughLibraries(foundTypes, new HashSet<String>(), api.uses()); return foundTypes; } }; } static ... |
### Question:
TypeFinders { public static TypeFinder everyWhere() { return new TypeFinder() { @Override public Iterable<TypeDeclaration> findTypes(Api api) { return FluentIterable.from(api.types()) .append(resourceTypes(api.resources())) .append(Utils.goThroughLibraries(new ArrayList<TypeDeclaration>(), new HashSet<Str... |
### Question:
Augmenter { public static<T> T augment(Class<T> augmentedInterface, final Object delegate) { try { Extension extension = augmentedInterface.getAnnotation(Extension.class); ExtensionFactory extensionFactory = augmentedInterface.getAnnotation(ExtensionFactory.class); if ( extension == null && extensionFacto... |
### Question:
ResponseBuilder extends KeyValueNodeBuilder<ResponseBuilder> implements NodeBuilder, AnnotableBuilder<ResponseBuilder> { static public ResponseBuilder response(int code) { return new ResponseBuilder(code); } private ResponseBuilder(int code); static ResponseBuilder response(int code); ResponseBuilder wit... |
### Question:
ResourceBuilder extends KeyValueNodeBuilder<ResourceBuilder> implements NodeBuilder { private ResourceBuilder(String name) { super(name); } private ResourceBuilder(String name); static ResourceBuilder resource(String name); @Override KeyValueNode buildNode(); ResourceBuilder displayName(String displayNam... |
### Question:
TypeBuilder extends ObjectNodeBuilder<TypeBuilder> implements NodeBuilder, AnnotableBuilder<TypeBuilder> { static public TypeBuilder type(String type) { return new TypeBuilder(type); } private TypeBuilder(String type); TypeBuilder(String[] types); TypeBuilder(TypeBuilder builder); String id(); static T... |
### Question:
Emitter { public void emit(Api api) throws IOException { emit(api, new OutputStreamWriter(System.out)); } Emitter(HandlerList list); Emitter(); void emit(Api api); void emit(Api api, Writer w); }### Answer:
@Test public void emit() throws Exception { when(api.getNode()).thenReturn(node); when(node.getCh... |
### Question:
HandlerList extends NodeHandler<Node> { @Override public boolean handles(final Node node) { return FluentIterable.from(handlerList).anyMatch(new Predicate<NodeHandler<? extends Node>>() { @Override public boolean apply(@Nullable NodeHandler<? extends Node> nodeHandler) { return nodeHandler.handles(node); ... |
### Question:
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handles(Node node) { return node instanceof ReferenceNode; } @Override boolean handles(Node node); @Override boolean handleSafely(ReferenceNode node, YamlEmitter emitter); }### Answer:
@Test public void handles() throws E... |
### Question:
ReferenceNodeHandler extends NodeHandler<ReferenceNode> { @Override public boolean handleSafely(ReferenceNode node, YamlEmitter emitter) throws IOException { emitter.writeObjectValue(node.getRefName()); return true; } @Override boolean handles(Node node); @Override boolean handleSafely(ReferenceNode node... |
### Question:
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handles(Node node) { return node instanceof TypeDeclarationNode; } TypeDeclarationNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(TypeDeclarationNode no... |
### Question:
TypeDeclarationNodeHandler extends NodeHandler<TypeDeclarationNode> { @Override public boolean handleSafely(TypeDeclarationNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { handlerList.handle(child, emitter); } return true; } TypeDeclarationNodeHandler(HandlerLis... |
### Question:
ArrayNodeHandler extends NodeHandler<ArrayNode> { @Override public boolean handles(Node node) { return node instanceof ArrayNode; } ArrayNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(ArrayNode node, YamlEmitter emitter); }### Answer:
@Test publ... |
### Question:
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handles(Node node) { return node instanceof KeyValueNode; } KeyValueNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(KeyValueNode node, YamlEmitter emitter); }### Ans... |
### Question:
KeyValueNodeHandler extends NodeHandler<KeyValueNode> { @Override public boolean handleSafely(KeyValueNode node, YamlEmitter emitter) throws IOException { String scalar = isScalar(node.getValue()); if ( scalar != null ) { emitter.writeTag(node.getKey().toString()); handlerList.handle(node.getValue(), emit... |
### Question:
SubclassedNodeHandler extends NodeHandler<T> { @Override public boolean handle(Node node, YamlEmitter emitter) { try { return subclassHandlerList.handle(node, emitter) || handleSafely((T) node, emitter); } catch (IOException e) { throw new RuntimeException(e); } } SubclassedNodeHandler(Class<?> superClass... |
### Question:
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handles(Node node) { return node instanceof TypeExpressionNode; } TypeExpressionNodeHandler(HandlerList handlerList); @Override boolean handles(Node node); @Override boolean handleSafely(TypeExpressionNo... |
### Question:
TypeExpressionNodeHandler extends SubclassedNodeHandler<TypeExpressionNode> { @Override public boolean handleSafely(TypeExpressionNode node, YamlEmitter emitter) throws IOException { List<LibraryRefNode> descs = node.findDescendantsWith(LibraryRefNode.class); if ( descs.size() != 0 && descs.get(0) != null... |
### Question:
ObjectNodeHandler extends SubclassedNodeHandler<ObjectNode> { @Override public boolean handleSafely(ObjectNode node, YamlEmitter emitter) throws IOException { for (Node child : node.getChildren()) { String scalar = isScalar(node.getChildren().get(0)); if ( scalar != null ) { emitter.writeObjectValue(scala... |
### Question:
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handles(Node node) { return node instanceof NullNode; } NullNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(NullNode node, YamlEmitter emitter); }### Answer:
@Test public void handles() throws Exc... |
### Question:
NullNodeHandler extends NodeHandler<NullNode> { @Override public boolean handleSafely(NullNode node, YamlEmitter emitter) throws IOException { return true; } NullNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(NullNode node, YamlEmitter emitter); }### Answer:
@Test pub... |
### Question:
SimpleTypeNodeHandler extends NodeHandler<SimpleTypeNode<?>> { @Override public boolean handles(Node node) { return node instanceof SimpleTypeNode; } SimpleTypeNodeHandler(); @Override boolean handles(Node node); @Override boolean handleSafely(SimpleTypeNode<?> node, YamlEmitter emitter); }### Answer:
@T... |
### Question:
ArabicUtilities { public static String handleTatweela(@NonNull String s) { Matcher matcher4 = TATWEELA_PATTERN.matcher(s); StringBuffer sb2 = new StringBuffer(); while (matcher4.find()) { matcher4.appendReplacement(sb2, "$1$3"); } matcher4.appendTail(sb2); return sb2.toString(); } static String cleanTash... |
### Question:
ArabicUtilities { public static boolean startsWithDefiniteArticle(@NonNull String string) { return string.startsWith("ال"); } static String cleanTashkeel(@NonNull String s); static String cleanTextForSearchingIndexing(String s); @NonNull static String cleanTextForSearchingQuery(@NonNull String s); static... |
### Question:
ConfigHelper { public static ConfigHelper fromFile(String file) throws IOException { return new ConfigHelper(file); } ConfigHelper(); ConfigHelper(Properties properties); @Inject ConfigHelper(List<ConfigHelper> configuration); private ConfigHelper(String configFilename); private ConfigHelper(File conf... |
### Question:
JpaMetamodelRedGProvider implements NameProvider, DataTypeProvider { @Override public String getClassNameForTable(Table table) { ManagedType managedType = managedTypesByTableName.get(table.getName().toUpperCase()); return managedType != null ? managedType.getJavaType().getSimpleName() : fallbackNameProvid... |
### Question:
RedGBuilder { public T build() { final T inst = instance; instance = null; return inst; } @SuppressWarnings("unchecked") RedGBuilder(); RedGBuilder(final Class<T> clazz); RedGBuilder<T> withDefaultValueStrategy(final DefaultValueStrategy strategy); RedGBuilder<T> withPreparedStatementParameterSetter(fin... |
### Question:
XmlFileDataTypeProvider implements DataTypeProvider { String getDataTypeByName(String tableName, String columnName) { if (typeMappings.getTableTypeMappings() == null) { return null; } return typeMappings.getTableTypeMappings().stream() .filter(tableTypeMapping -> tableName.matches(tableTypeMapping.getTabl... |
### Question:
TableModelExtractor { public static List<TableModel> extractTableModelsFromSourceCode(final Path srcDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException { LOG.debug("Starting table model extraction from source code..."); final List<TableModel> results = new A... |
### Question:
TableModelExtractor { public static List<TableModel> extractTableModelFromClasses(final Path classDir, final String packageName, final String classPrefix) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { LOG.debug("Starting table model ... |
### Question:
XmlFileDataTypeProvider implements DataTypeProvider { @Override public String getCanonicalDataTypeName(final Column column) { String dataTypeByName = getDataTypeByName(column.getParent().getName(), column.getName()); String dataTypeByType = getDataTypeBySqlType(column); return dataTypeByName != null ? dat... |
### Question:
XmlFileConvenienceSetterProvider implements ConvenienceSetterProvider { @Override public List<ConvenienceSetterModel> getConvenienceSetters(Column column, String javaDataTypeName) { return this.convenienceSetterConfig.getConvenienceSetterConfigs().stream() .filter(dataTypeConvenienceSetterConfig -> dataTy... |
### Question:
DatabaseManager { public static Connection connectToDatabase(final String jdbcDriver, final String connectionString, final String username, final String password) throws ClassNotFoundException, SQLException { try { LOG.debug("Trying to load jdbc driver " + jdbcDriver); Class.forName(jdbcDriver); LOG.info(... |
### Question:
NameUtils { public static String firstCharacterToLowerCase(final String s) { if (s == null || s.length() < 1) { return s; } final char[] letters = s.toCharArray(); letters[0] = Character.toLowerCase(letters[0]); return new String(letters); } static String firstCharacterToLowerCase(final String s); static... |
### Question:
NameUtils { public static String firstCharacterToUpperCase(final String s) { if (s == null || s.length() < 1) { return s; } final char[] letters = s.toCharArray(); letters[0] = Character.toUpperCase(letters[0]); return new String(letters); } static String firstCharacterToLowerCase(final String s); static... |
### Question:
JavaSqlStringEscapeMap extends AbstractMap<String, Object> { @Override public Object get(Object key) { if (key instanceof String) { String str = (String) key; return this.escapeStringBefore + str.replace("\"", "") + this.escapeStringAfter; } return super.get(key); } JavaSqlStringEscapeMap(String escapeStr... |
### Question:
JavaSqlStringEscapeMap extends AbstractMap<String, Object> { @Override public boolean containsKey(Object key) { return (key instanceof String); } JavaSqlStringEscapeMap(String escapeStringBefore, String escapeStringAfter); JavaSqlStringEscapeMap(String escapeString); JavaSqlStringEscapeMap(); @Override ... |
### Question:
ClassAvailabilityChecker { public boolean isAvailable() { return available; } ClassAvailabilityChecker(String fqcn); boolean isAvailable(); }### Answer:
@Test public void testHappyPaths() throws Exception { Assert.assertTrue(new ClassAvailabilityChecker("java.util.HashMap").isAvailable()); Assert.assertF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.