repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
payneteasy/superfly | superfly-web/src/main/java/com/payneteasy/superfly/web/wicket/component/label/DateLabels.java | DateLabels.forDateTime | public static DateLabel forDateTime(String id, Date date) {
return DateLabel.forDatePattern(id, new Model<Date>(date),
DATE_TIME_PATTERN);
} | java | public static DateLabel forDateTime(String id, Date date) {
return DateLabel.forDatePattern(id, new Model<Date>(date),
DATE_TIME_PATTERN);
} | [
"public",
"static",
"DateLabel",
"forDateTime",
"(",
"String",
"id",
",",
"Date",
"date",
")",
"{",
"return",
"DateLabel",
".",
"forDatePattern",
"(",
"id",
",",
"new",
"Model",
"<",
"Date",
">",
"(",
"date",
")",
",",
"DATE_TIME_PATTERN",
")",
";",
"}"
... | Creates a label which displays date and time.
@param id component id
@param date date to display
@return date label | [
"Creates",
"a",
"label",
"which",
"displays",
"date",
"and",
"time",
"."
] | 4cad6d0f8e951a61f3c302c49b13a51d179076f8 | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-web/src/main/java/com/payneteasy/superfly/web/wicket/component/label/DateLabels.java#L48-L51 | train |
mojohaus/mrm | mrm-api/src/main/java/org/codehaus/mojo/mrm/api/BaseFileSystem.java | BaseFileSystem.get | protected Entry get( DirectoryEntry parent, String name )
{
parent.getClass();
Entry[] entries = listEntries( parent );
if ( entries != null )
{
for ( int i = 0; i < entries.length; i++ )
{
if ( name.equals( entries[i].getName() ) )
... | java | protected Entry get( DirectoryEntry parent, String name )
{
parent.getClass();
Entry[] entries = listEntries( parent );
if ( entries != null )
{
for ( int i = 0; i < entries.length; i++ )
{
if ( name.equals( entries[i].getName() ) )
... | [
"protected",
"Entry",
"get",
"(",
"DirectoryEntry",
"parent",
",",
"String",
"name",
")",
"{",
"parent",
".",
"getClass",
"(",
")",
";",
"Entry",
"[",
"]",
"entries",
"=",
"listEntries",
"(",
"parent",
")",
";",
"if",
"(",
"entries",
"!=",
"null",
")",... | Gets the named entry in the specified directory.
The default implementation lists all the entries in the directory and looks for the one with the matching name.
Caching implementations will likely want to override this behaviour.
@param parent the directory.
@param name the name of the entry to get.
@return the {@li... | [
"Gets",
"the",
"named",
"entry",
"in",
"the",
"specified",
"directory",
".",
"The",
"default",
"implementation",
"lists",
"all",
"the",
"entries",
"in",
"the",
"directory",
"and",
"looks",
"for",
"the",
"one",
"with",
"the",
"matching",
"name",
".",
"Caching... | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-api/src/main/java/org/codehaus/mojo/mrm/api/BaseFileSystem.java#L86-L101 | train |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/DiskFileSystem.java | DiskFileSystem.toFile | private File toFile( Entry entry )
{
Stack<String> stack = new Stack<String>();
Entry entryRoot = entry.getFileSystem().getRoot();
while ( entry != null && !entryRoot.equals( entry ) )
{
String name = entry.getName();
if ( "..".equals( name ) )
{
... | java | private File toFile( Entry entry )
{
Stack<String> stack = new Stack<String>();
Entry entryRoot = entry.getFileSystem().getRoot();
while ( entry != null && !entryRoot.equals( entry ) )
{
String name = entry.getName();
if ( "..".equals( name ) )
{
... | [
"private",
"File",
"toFile",
"(",
"Entry",
"entry",
")",
"{",
"Stack",
"<",
"String",
">",
"stack",
"=",
"new",
"Stack",
"<",
"String",
">",
"(",
")",
";",
"Entry",
"entryRoot",
"=",
"entry",
".",
"getFileSystem",
"(",
")",
".",
"getRoot",
"(",
")",
... | Convert an entry into the corresponding file path.
@param entry the entry.
@return the corresponding file.
@since 1.0 | [
"Convert",
"an",
"entry",
"into",
"the",
"corresponding",
"file",
"path",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/DiskFileSystem.java#L120-L146 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/schema/SchemaValidator.java | SchemaValidator.validateSchema | public static void validateSchema(Bean bean) {
validateId(bean);
validatePropertyNames(bean);
validateReferences(bean);
validateProperties(bean);
validatePropertyList(bean);
validatePropertyReferences(bean);
validatePropertyRefList(bean);
validatePropertyR... | java | public static void validateSchema(Bean bean) {
validateId(bean);
validatePropertyNames(bean);
validateReferences(bean);
validateProperties(bean);
validatePropertyList(bean);
validatePropertyReferences(bean);
validatePropertyRefList(bean);
validatePropertyR... | [
"public",
"static",
"void",
"validateSchema",
"(",
"Bean",
"bean",
")",
"{",
"validateId",
"(",
"bean",
")",
";",
"validatePropertyNames",
"(",
"bean",
")",
";",
"validateReferences",
"(",
"bean",
")",
";",
"validateProperties",
"(",
"bean",
")",
";",
"valid... | Validate that the value of the bean is according to schema. | [
"Validate",
"that",
"the",
"value",
"of",
"the",
"bean",
"is",
"according",
"to",
"schema",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/schema/SchemaValidator.java#L48-L57 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/BeanManager.java | BeanManager.initializeReferences | public final void initializeReferences(Collection<Bean> beans) {
Map<BeanId, Bean> indexed = BeanUtils.uniqueIndex(beans);
for (Bean bean : beans) {
for (String name : bean.getReferenceNames()) {
List<BeanId> ids = bean.getReference(name);
if (ids == null... | java | public final void initializeReferences(Collection<Bean> beans) {
Map<BeanId, Bean> indexed = BeanUtils.uniqueIndex(beans);
for (Bean bean : beans) {
for (String name : bean.getReferenceNames()) {
List<BeanId> ids = bean.getReference(name);
if (ids == null... | [
"public",
"final",
"void",
"initializeReferences",
"(",
"Collection",
"<",
"Bean",
">",
"beans",
")",
"{",
"Map",
"<",
"BeanId",
",",
"Bean",
">",
"indexed",
"=",
"BeanUtils",
".",
"uniqueIndex",
"(",
"beans",
")",
";",
"for",
"(",
"Bean",
"bean",
":",
... | Initialize references that lack a bean instance eagerly.
@param beans to be initialized | [
"Initialize",
"references",
"that",
"lack",
"a",
"bean",
"instance",
"eagerly",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/BeanManager.java#L77-L97 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Schema.java | Schema.create | public static Schema create(SchemaId id, final String classType, final String name,
final String description) {
return new Schema(id, classType, name, description);
} | java | public static Schema create(SchemaId id, final String classType, final String name,
final String description) {
return new Schema(id, classType, name, description);
} | [
"public",
"static",
"Schema",
"create",
"(",
"SchemaId",
"id",
",",
"final",
"String",
"classType",
",",
"final",
"String",
"name",
",",
"final",
"String",
"description",
")",
"{",
"return",
"new",
"Schema",
"(",
"id",
",",
"classType",
",",
"name",
",",
... | Creates a new schema. Not to be used by users, schemas are created when a configurable class are
registered in the system.
@param id that identify this schema.
@param classType classname that fully qualifies the configurable class that this schema originates from.
@param name of this schema as specified in meta data, ... | [
"Creates",
"a",
"new",
"schema",
".",
"Not",
"to",
"be",
"used",
"by",
"users",
"schemas",
"are",
"created",
"when",
"a",
"configurable",
"class",
"are",
"registered",
"in",
"the",
"system",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Schema.java#L74-L77 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Schema.java | Schema.getClassType | public Class<?> getClassType() {
try {
return Class.forName(getType(), true, ClassLoaderHolder.getClassLoader());
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}
} | java | public Class<?> getClassType() {
try {
return Class.forName(getType(), true, ClassLoaderHolder.getClassLoader());
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}
} | [
"public",
"Class",
"<",
"?",
">",
"getClassType",
"(",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"getType",
"(",
")",
",",
"true",
",",
"ClassLoaderHolder",
".",
"getClassLoader",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ClassNotFoun... | This is the fully qualified classname of the configurable class that this schema originates from.
@return Class of this schema. | [
"This",
"is",
"the",
"fully",
"qualified",
"classname",
"of",
"the",
"configurable",
"class",
"that",
"this",
"schema",
"originates",
"from",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Schema.java#L104-L110 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Schema.java | Schema.add | public void add(AbstractSchemaProperty property) {
Class type = property.getClass();
properties.put(type, property);
if (SchemaProperty.class.isAssignableFrom(type)) {
propertyNames.add(property.getName());
} else if (SchemaPropertyList.class.isAssignableFrom(type)) {
... | java | public void add(AbstractSchemaProperty property) {
Class type = property.getClass();
properties.put(type, property);
if (SchemaProperty.class.isAssignableFrom(type)) {
propertyNames.add(property.getName());
} else if (SchemaPropertyList.class.isAssignableFrom(type)) {
... | [
"public",
"void",
"add",
"(",
"AbstractSchemaProperty",
"property",
")",
"{",
"Class",
"type",
"=",
"property",
".",
"getClass",
"(",
")",
";",
"properties",
".",
"put",
"(",
"type",
",",
"property",
")",
";",
"if",
"(",
"SchemaProperty",
".",
"class",
"... | Adds a property of a specific type to this schema. Not to be used by users.
@param property property | [
"Adds",
"a",
"property",
"of",
"a",
"specific",
"type",
"to",
"this",
"schema",
".",
"Not",
"to",
"be",
"used",
"by",
"users",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Schema.java#L137-L153 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Schema.java | Schema.getIndexed | public <T extends AbstractSchemaProperty> Set<T> getIndexed() {
HashSet<AbstractSchemaProperty> indexed = new HashSet<>();
for (AbstractSchemaProperty prop : properties.values()) {
if (prop.isIndexed()) indexed.add(prop);
}
return (Set<T>) indexed;
} | java | public <T extends AbstractSchemaProperty> Set<T> getIndexed() {
HashSet<AbstractSchemaProperty> indexed = new HashSet<>();
for (AbstractSchemaProperty prop : properties.values()) {
if (prop.isIndexed()) indexed.add(prop);
}
return (Set<T>) indexed;
} | [
"public",
"<",
"T",
"extends",
"AbstractSchemaProperty",
">",
"Set",
"<",
"T",
">",
"getIndexed",
"(",
")",
"{",
"HashSet",
"<",
"AbstractSchemaProperty",
">",
"indexed",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"AbstractSchemaProperty",
"prop... | Returns all properties that have been marked as indexed.
@param <T> type
@return a list of properties. | [
"Returns",
"all",
"properties",
"that",
"have",
"been",
"marked",
"as",
"indexed",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Schema.java#L161-L167 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Schema.java | Schema.get | @SuppressWarnings({ "unchecked", "rawtypes" })
public <T extends AbstractSchemaProperty> Set<T> get(final Class<T> clazz) {
return (Set<T>) properties.get(clazz);
} | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public <T extends AbstractSchemaProperty> Set<T> get(final Class<T> clazz) {
return (Set<T>) properties.get(clazz);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"<",
"T",
"extends",
"AbstractSchemaProperty",
">",
"Set",
"<",
"T",
">",
"get",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"(",
"Set",
... | Returns all the properties of a particular type.
@param clazz The specific type of properties to get.
@return A list of properties that matches the clazz. | [
"Returns",
"all",
"the",
"properties",
"of",
"a",
"particular",
"type",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Schema.java#L175-L178 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Schema.java | Schema.get | public <T extends AbstractSchemaProperty> T get(final Class<T> clazz, final String name) {
Set<T> propertyCollection = get(clazz);
for (T property : propertyCollection) {
if (property.getName().equals(name)) {
return property;
}
}
return null;
... | java | public <T extends AbstractSchemaProperty> T get(final Class<T> clazz, final String name) {
Set<T> propertyCollection = get(clazz);
for (T property : propertyCollection) {
if (property.getName().equals(name)) {
return property;
}
}
return null;
... | [
"public",
"<",
"T",
"extends",
"AbstractSchemaProperty",
">",
"T",
"get",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"String",
"name",
")",
"{",
"Set",
"<",
"T",
">",
"propertyCollection",
"=",
"get",
"(",
"clazz",
")",
";",
"for",
... | Returns a specific properties of a particular type identified with a name.
@param clazz specific type of property to get.
@param name The AbstractSchemaProperty name of the property.
@return Matching property. | [
"Returns",
"a",
"specific",
"properties",
"of",
"a",
"particular",
"type",
"identified",
"with",
"a",
"name",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Schema.java#L207-L215 | train |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java | VelocityEngineFactory.setVelocityPropertiesMap | public void setVelocityPropertiesMap(Map<String, Object> velocityPropertiesMap) {
if (velocityPropertiesMap != null) {
this.velocityProperties.putAll(velocityPropertiesMap);
}
} | java | public void setVelocityPropertiesMap(Map<String, Object> velocityPropertiesMap) {
if (velocityPropertiesMap != null) {
this.velocityProperties.putAll(velocityPropertiesMap);
}
} | [
"public",
"void",
"setVelocityPropertiesMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"velocityPropertiesMap",
")",
"{",
"if",
"(",
"velocityPropertiesMap",
"!=",
"null",
")",
"{",
"this",
".",
"velocityProperties",
".",
"putAll",
"(",
"velocityPropertiesMa... | Set Velocity properties as Map, to allow for non-String values
like "ds.resource.loader.instance".
@see #setVelocityProperties | [
"Set",
"Velocity",
"properties",
"as",
"Map",
"to",
"allow",
"for",
"non",
"-",
"String",
"values",
"like",
"ds",
".",
"resource",
".",
"loader",
".",
"instance",
"."
] | 4cad6d0f8e951a61f3c302c49b13a51d179076f8 | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java#L123-L127 | train |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java | VelocityEngineFactory.createVelocityEngine | public VelocityEngine createVelocityEngine() throws IOException, VelocityException {
VelocityEngine velocityEngine = newVelocityEngine();
Map<String, Object> props = new HashMap<String, Object>();
// Load config file if set.
if (this.configLocation != null) {
if (logger.isInfoEnabled()) {
logger.info("L... | java | public VelocityEngine createVelocityEngine() throws IOException, VelocityException {
VelocityEngine velocityEngine = newVelocityEngine();
Map<String, Object> props = new HashMap<String, Object>();
// Load config file if set.
if (this.configLocation != null) {
if (logger.isInfoEnabled()) {
logger.info("L... | [
"public",
"VelocityEngine",
"createVelocityEngine",
"(",
")",
"throws",
"IOException",
",",
"VelocityException",
"{",
"VelocityEngine",
"velocityEngine",
"=",
"newVelocityEngine",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
"=",
"new",
"HashM... | Prepare the VelocityEngine instance and return it.
@return the VelocityEngine instance
@throws IOException if the config file wasn't found
@throws VelocityException on Velocity initialization failure | [
"Prepare",
"the",
"VelocityEngine",
"instance",
"and",
"return",
"it",
"."
] | 4cad6d0f8e951a61f3c302c49b13a51d179076f8 | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/spring/velocity/VelocityEngineFactory.java#L216-L254 | train |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/maven/MockArtifactStore.java | MockArtifactStore.set | private synchronized void set( Artifact artifact, Content content )
{
Map<String, Map<String, Map<Artifact, Content>>> artifactMap = contents.get( artifact.getGroupId() );
if ( artifactMap == null )
{
artifactMap = new HashMap<String, Map<String, Map<Artifact, Content>>>();
... | java | private synchronized void set( Artifact artifact, Content content )
{
Map<String, Map<String, Map<Artifact, Content>>> artifactMap = contents.get( artifact.getGroupId() );
if ( artifactMap == null )
{
artifactMap = new HashMap<String, Map<String, Map<Artifact, Content>>>();
... | [
"private",
"synchronized",
"void",
"set",
"(",
"Artifact",
"artifact",
",",
"Content",
"content",
")",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"Artifact",
",",
"Content",
">",
">",
">",
"artifactMap",
"=",
"contents",
".",
... | Sets the content for a specified artifact.
@param artifact the artifact.
@param content the content.
@since 1.0 | [
"Sets",
"the",
"content",
"for",
"a",
"specified",
"artifact",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/maven/MockArtifactStore.java#L424-L445 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/BeanId.java | BeanId.create | public static BeanId create(final String instanceId, final String schemaName) {
if (instanceId == null || "".equals(instanceId)) {
throw CFG107_MISSING_ID();
}
return new BeanId(instanceId, schemaName);
} | java | public static BeanId create(final String instanceId, final String schemaName) {
if (instanceId == null || "".equals(instanceId)) {
throw CFG107_MISSING_ID();
}
return new BeanId(instanceId, schemaName);
} | [
"public",
"static",
"BeanId",
"create",
"(",
"final",
"String",
"instanceId",
",",
"final",
"String",
"schemaName",
")",
"{",
"if",
"(",
"instanceId",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"instanceId",
")",
")",
"{",
"throw",
"CFG107_MISSING_ID",
... | Create a bean identification.
@param instanceId of this bean.
@param schemaName The bean schema name.
@return AdminBeanId | [
"Create",
"a",
"bean",
"identification",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/BeanId.java#L44-L49 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanPredecessors.java | HBeanPredecessors.isPredecessor | public static boolean isPredecessor(KeyValue kv) {
if (Bytes.equals(kv.getFamily(), PRED_COLUMN_FAMILY)) {
return true;
}
return false;
} | java | public static boolean isPredecessor(KeyValue kv) {
if (Bytes.equals(kv.getFamily(), PRED_COLUMN_FAMILY)) {
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isPredecessor",
"(",
"KeyValue",
"kv",
")",
"{",
"if",
"(",
"Bytes",
".",
"equals",
"(",
"kv",
".",
"getFamily",
"(",
")",
",",
"PRED_COLUMN_FAMILY",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"... | If this key value is of predecessor familiy type. | [
"If",
"this",
"key",
"value",
"is",
"of",
"predecessor",
"familiy",
"type",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanPredecessors.java#L90-L95 | train |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/hotp/HOTPProviderUtils.java | HOTPProviderUtils.instantiateProvider | public static HOTPProvider instantiateProvider(boolean allowTestProvider) {
HOTPProvider resultProvider = null;
ServiceLoader<HOTPProvider> loader = ServiceLoader.load(HOTPProvider.class);
Iterator<HOTPProvider> iterator = loader.iterator();
if (iterator.hasNext()) {
while (i... | java | public static HOTPProvider instantiateProvider(boolean allowTestProvider) {
HOTPProvider resultProvider = null;
ServiceLoader<HOTPProvider> loader = ServiceLoader.load(HOTPProvider.class);
Iterator<HOTPProvider> iterator = loader.iterator();
if (iterator.hasNext()) {
while (i... | [
"public",
"static",
"HOTPProvider",
"instantiateProvider",
"(",
"boolean",
"allowTestProvider",
")",
"{",
"HOTPProvider",
"resultProvider",
"=",
"null",
";",
"ServiceLoader",
"<",
"HOTPProvider",
">",
"loader",
"=",
"ServiceLoader",
".",
"load",
"(",
"HOTPProvider",
... | Instantiates a provider using service loader.
@param allowTestProvider whether test provider is allowed (must be
false for normal cases)
@return instantiated provider or null | [
"Instantiates",
"a",
"provider",
"using",
"service",
"loader",
"."
] | 4cad6d0f8e951a61f3c302c49b13a51d179076f8 | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/hotp/HOTPProviderUtils.java#L21-L36 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/Lookup.java | Lookup.get | public static Lookup get() {
if (LOOKUP != null) {
return LOOKUP;
}
synchronized (Lookup.class) {
// allow for override of the Lookup.class
String overrideClassName = System.getProperty(Lookup.class.getName());
ClassLoader l = Thread.currentThread(... | java | public static Lookup get() {
if (LOOKUP != null) {
return LOOKUP;
}
synchronized (Lookup.class) {
// allow for override of the Lookup.class
String overrideClassName = System.getProperty(Lookup.class.getName());
ClassLoader l = Thread.currentThread(... | [
"public",
"static",
"Lookup",
"get",
"(",
")",
"{",
"if",
"(",
"LOOKUP",
"!=",
"null",
")",
"{",
"return",
"LOOKUP",
";",
"}",
"synchronized",
"(",
"Lookup",
".",
"class",
")",
"{",
"// allow for override of the Lookup.class",
"String",
"overrideClassName",
"=... | Acquire the Lookup registry.
@return The lookup registry. | [
"Acquire",
"the",
"Lookup",
"registry",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/Lookup.java#L39-L69 | train |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/servlet/FileSystemServlet.java | FileSystemServlet.formatName | private static String formatName( String name )
{
if ( name.length() < NAME_COL_WIDTH )
{
return name;
}
return name.substring( 0, NAME_COL_WIDTH - 1 ) + ">";
} | java | private static String formatName( String name )
{
if ( name.length() < NAME_COL_WIDTH )
{
return name;
}
return name.substring( 0, NAME_COL_WIDTH - 1 ) + ">";
} | [
"private",
"static",
"String",
"formatName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"<",
"NAME_COL_WIDTH",
")",
"{",
"return",
"name",
";",
"}",
"return",
"name",
".",
"substring",
"(",
"0",
",",
"NAME_COL_WIDTH",
... | Formats a name for the fixed width layout of the html index.
@param name the name.
@return the name or the name shortened to 50 characters. | [
"Formats",
"a",
"name",
"for",
"the",
"fixed",
"width",
"layout",
"of",
"the",
"html",
"index",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-servlet/src/main/java/org/codehaus/mojo/mrm/servlet/FileSystemServlet.java#L383-L390 | train |
deephacks/confit | provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigProxyGenerator.java | ConfigProxyGenerator.instrument | private void instrument(CtClass proxy, final SchemaPropertyRef ref) throws Exception {
final Schema schema = schemas.get(ref.getSchemaName());
checkNotNull(schema, "Schema not found for SchemaPropertyRef ["+ref+"]");
final String fieldName = ref.getFieldName();
// for help on javassist s... | java | private void instrument(CtClass proxy, final SchemaPropertyRef ref) throws Exception {
final Schema schema = schemas.get(ref.getSchemaName());
checkNotNull(schema, "Schema not found for SchemaPropertyRef ["+ref+"]");
final String fieldName = ref.getFieldName();
// for help on javassist s... | [
"private",
"void",
"instrument",
"(",
"CtClass",
"proxy",
",",
"final",
"SchemaPropertyRef",
"ref",
")",
"throws",
"Exception",
"{",
"final",
"Schema",
"schema",
"=",
"schemas",
".",
"get",
"(",
"ref",
".",
"getSchemaName",
"(",
")",
")",
";",
"checkNotNull"... | Instrument a single reference field, using the ConfigReferenceHolder to fetch the real
reference from the cache and replace it with a real object. | [
"Instrument",
"a",
"single",
"reference",
"field",
"using",
"the",
"ConfigReferenceHolder",
"to",
"fetch",
"the",
"real",
"reference",
"from",
"the",
"cache",
"and",
"replace",
"it",
"with",
"a",
"real",
"object",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigProxyGenerator.java#L193-L210 | train |
deephacks/confit | provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/BytesUtils.java | BytesUtils.remove | public static byte[] remove(byte[] arr, int n) {
int index = binarySearch(arr, n);
byte[] arr2 = new byte[arr.length - 4];
System.arraycopy(arr, 0, arr2, 0, index);
System.arraycopy(arr, index + 4, arr2, index, arr.length - index - 4);
return arr2;
} | java | public static byte[] remove(byte[] arr, int n) {
int index = binarySearch(arr, n);
byte[] arr2 = new byte[arr.length - 4];
System.arraycopy(arr, 0, arr2, 0, index);
System.arraycopy(arr, index + 4, arr2, index, arr.length - index - 4);
return arr2;
} | [
"public",
"static",
"byte",
"[",
"]",
"remove",
"(",
"byte",
"[",
"]",
"arr",
",",
"int",
"n",
")",
"{",
"int",
"index",
"=",
"binarySearch",
"(",
"arr",
",",
"n",
")",
";",
"byte",
"[",
"]",
"arr2",
"=",
"new",
"byte",
"[",
"arr",
".",
"length... | Remove a big-endian 4-byte integer to a sorted array of bytes.
@param arr This byte array is assumed to be sorted array
of signed ints.
@param n value to remove.
@return new array with the added value. | [
"Remove",
"a",
"big",
"-",
"endian",
"4",
"-",
"byte",
"integer",
"to",
"a",
"sorted",
"array",
"of",
"bytes",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/BytesUtils.java#L61-L67 | train |
deephacks/confit | provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/BytesUtils.java | BytesUtils.binarySearch | public static int binarySearch(byte[] a, int key) {
int low = 0;
int high = a.length;
while (low < high) {
int mid = (low + high) >>> 1;
if (mid % 4 != 0) {
if (high == a.length) {
mid = low;
} else {
... | java | public static int binarySearch(byte[] a, int key) {
int low = 0;
int high = a.length;
while (low < high) {
int mid = (low + high) >>> 1;
if (mid % 4 != 0) {
if (high == a.length) {
mid = low;
} else {
... | [
"public",
"static",
"int",
"binarySearch",
"(",
"byte",
"[",
"]",
"a",
",",
"int",
"key",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"a",
".",
"length",
";",
"while",
"(",
"low",
"<",
"high",
")",
"{",
"int",
"mid",
"=",
"(",
... | Search for a big-endian 4-byte integer in a array of bytes.
@param a array of containing only big-endian 4-byte integers.
@param key the value to seach for.
@return the index found. | [
"Search",
"for",
"a",
"big",
"-",
"endian",
"4",
"-",
"byte",
"integer",
"in",
"a",
"array",
"of",
"bytes",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/BytesUtils.java#L76-L103 | train |
mojohaus/mrm | mrm-maven-plugin/src/main/java/org/codehaus/mojo/mrm/plugin/AbstractStartMojo.java | AbstractStartMojo.createFileSystemServer | protected FileSystemServer createFileSystemServer( ArtifactStore artifactStore )
{
return new FileSystemServer( ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ),
Math.max( 0, Math.min( port, 65535 ) ),
new... | java | protected FileSystemServer createFileSystemServer( ArtifactStore artifactStore )
{
return new FileSystemServer( ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ),
Math.max( 0, Math.min( port, 65535 ) ),
new... | [
"protected",
"FileSystemServer",
"createFileSystemServer",
"(",
"ArtifactStore",
"artifactStore",
")",
"{",
"return",
"new",
"FileSystemServer",
"(",
"ArtifactUtils",
".",
"versionlessKey",
"(",
"project",
".",
"getGroupId",
"(",
")",
",",
"project",
".",
"getArtifact... | Creates a file system server from an artifact store.
@param artifactStore the artifact store to serve.
@return the file system server. | [
"Creates",
"a",
"file",
"system",
"server",
"from",
"an",
"artifact",
"store",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-maven-plugin/src/main/java/org/codehaus/mojo/mrm/plugin/AbstractStartMojo.java#L58-L64 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java | JpaProperty.deleteProperties | public static void deleteProperties(BeanId id) {
Query query = getEmOrFail().createNamedQuery(DELETE_ALL_PROPERTIES_FOR_BEANID_NAME);
query.setParameter(1, id.getInstanceId());
query.setParameter(2, id.getSchemaName());
query.setParameter(3, BEAN_MARKER_PROPERTY_NAME);
que... | java | public static void deleteProperties(BeanId id) {
Query query = getEmOrFail().createNamedQuery(DELETE_ALL_PROPERTIES_FOR_BEANID_NAME);
query.setParameter(1, id.getInstanceId());
query.setParameter(2, id.getSchemaName());
query.setParameter(3, BEAN_MARKER_PROPERTY_NAME);
que... | [
"public",
"static",
"void",
"deleteProperties",
"(",
"BeanId",
"id",
")",
"{",
"Query",
"query",
"=",
"getEmOrFail",
"(",
")",
".",
"createNamedQuery",
"(",
"DELETE_ALL_PROPERTIES_FOR_BEANID_NAME",
")",
";",
"query",
".",
"setParameter",
"(",
"1",
",",
"id",
"... | Delete list properties EXCEPT the marker. This is useful for 'set' operations
that need to clear existing properties. | [
"Delete",
"list",
"properties",
"EXCEPT",
"the",
"marker",
".",
"This",
"is",
"useful",
"for",
"set",
"operations",
"that",
"need",
"to",
"clear",
"existing",
"properties",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java#L97-L105 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java | JpaProperty.deletePropertiesAndMarker | public static void deletePropertiesAndMarker(BeanId id) {
Query query = getEmOrFail().createNamedQuery(DELETE_ALL_PROPERTIES_FOR_BEANID_NAME);
query.setParameter(1, id.getInstanceId());
query.setParameter(2, id.getSchemaName());
// empty will marker will delete the marker aswell
... | java | public static void deletePropertiesAndMarker(BeanId id) {
Query query = getEmOrFail().createNamedQuery(DELETE_ALL_PROPERTIES_FOR_BEANID_NAME);
query.setParameter(1, id.getInstanceId());
query.setParameter(2, id.getSchemaName());
// empty will marker will delete the marker aswell
... | [
"public",
"static",
"void",
"deletePropertiesAndMarker",
"(",
"BeanId",
"id",
")",
"{",
"Query",
"query",
"=",
"getEmOrFail",
"(",
")",
".",
"createNamedQuery",
"(",
"DELETE_ALL_PROPERTIES_FOR_BEANID_NAME",
")",
";",
"query",
".",
"setParameter",
"(",
"1",
",",
... | Deletes the JpaBean and list its properties and the marker. | [
"Deletes",
"the",
"JpaBean",
"and",
"list",
"its",
"properties",
"and",
"the",
"marker",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java#L110-L118 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java | JpaProperty.filterMarkerProperty | public static void filterMarkerProperty(List<JpaProperty> properties) {
ListIterator<JpaProperty> propIt = properties.listIterator();
while (propIt.hasNext()) {
if (BEAN_MARKER_PROPERTY_NAME.equals(propIt.next().getPropertyName())) {
propIt.remove();
}
... | java | public static void filterMarkerProperty(List<JpaProperty> properties) {
ListIterator<JpaProperty> propIt = properties.listIterator();
while (propIt.hasNext()) {
if (BEAN_MARKER_PROPERTY_NAME.equals(propIt.next().getPropertyName())) {
propIt.remove();
}
... | [
"public",
"static",
"void",
"filterMarkerProperty",
"(",
"List",
"<",
"JpaProperty",
">",
"properties",
")",
"{",
"ListIterator",
"<",
"JpaProperty",
">",
"propIt",
"=",
"properties",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"propIt",
".",
"hasNext",
... | This property has no other meaning than knowing that a bean
exits only by looking at the properties table.
So remove the marker property from result of a fetch operation. | [
"This",
"property",
"has",
"no",
"other",
"meaning",
"than",
"knowing",
"that",
"a",
"bean",
"exits",
"only",
"by",
"looking",
"at",
"the",
"properties",
"table",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java#L301-L308 | train |
deephacks/confit | api-admin/src/main/java/org/deephacks/confit/admin/query/BeanQueryBuilder.java | BeanQueryBuilder.between | public static <A extends Comparable<A>> BeanRestriction between(String property, A lower, A upper) {
return new Between<>(property, lower, upper);
} | java | public static <A extends Comparable<A>> BeanRestriction between(String property, A lower, A upper) {
return new Between<>(property, lower, upper);
} | [
"public",
"static",
"<",
"A",
"extends",
"Comparable",
"<",
"A",
">",
">",
"BeanRestriction",
"between",
"(",
"String",
"property",
",",
"A",
"lower",
",",
"A",
"upper",
")",
"{",
"return",
"new",
"Between",
"<>",
"(",
"property",
",",
"lower",
",",
"u... | Query which asserts that a property is between a lower and an upper bound,
inclusive.
@param property field to query
@param lower lower value to be asserted by the query
@param upper upper value to be asserted by the query
@return restriction to be added to {@link BeanQuery}. | [
"Query",
"which",
"asserts",
"that",
"a",
"property",
"is",
"between",
"a",
"lower",
"and",
"an",
"upper",
"bound",
"inclusive",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-admin/src/main/java/org/deephacks/confit/admin/query/BeanQueryBuilder.java#L47-L49 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java | NotificationManager.fireCreate | public final void fireCreate(Collection<Bean> beans) {
ConfigChanges changes = new ConfigChanges();
for (Bean bean : beans) {
changes.add(ConfigChange.created(bean));
}
fire(changes);
} | java | public final void fireCreate(Collection<Bean> beans) {
ConfigChanges changes = new ConfigChanges();
for (Bean bean : beans) {
changes.add(ConfigChange.created(bean));
}
fire(changes);
} | [
"public",
"final",
"void",
"fireCreate",
"(",
"Collection",
"<",
"Bean",
">",
"beans",
")",
"{",
"ConfigChanges",
"changes",
"=",
"new",
"ConfigChanges",
"(",
")",
";",
"for",
"(",
"Bean",
"bean",
":",
"beans",
")",
"{",
"changes",
".",
"add",
"(",
"Co... | Fire a notification for a collection of beans that have been created.
@param beans created beans | [
"Fire",
"a",
"notification",
"for",
"a",
"collection",
"of",
"beans",
"that",
"have",
"been",
"created",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java#L65-L71 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java | NotificationManager.deleted | public final ConfigChanges deleted(String schemaName, Collection<String> instanceIds) {
ConfigChanges changes = new ConfigChanges();
for (String instanceId : instanceIds) {
BeanId id = BeanId.create(instanceId, schemaName);
Optional<Bean> before = beanManager.getEager(id);
... | java | public final ConfigChanges deleted(String schemaName, Collection<String> instanceIds) {
ConfigChanges changes = new ConfigChanges();
for (String instanceId : instanceIds) {
BeanId id = BeanId.create(instanceId, schemaName);
Optional<Bean> before = beanManager.getEager(id);
... | [
"public",
"final",
"ConfigChanges",
"deleted",
"(",
"String",
"schemaName",
",",
"Collection",
"<",
"String",
">",
"instanceIds",
")",
"{",
"ConfigChanges",
"changes",
"=",
"new",
"ConfigChanges",
"(",
")",
";",
"for",
"(",
"String",
"instanceId",
":",
"instan... | Create a changes object from a delete operation.
@param schemaName schemaName of deleted instances
@param instanceIds id of deleted instances
@return changes object | [
"Create",
"a",
"changes",
"object",
"from",
"a",
"delete",
"operation",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java#L80-L93 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java | NotificationManager.fireDelete | public final void fireDelete(List<Bean> beans) {
ConfigChanges changes = new ConfigChanges();
for (Bean bean : beans) {
changes.add(ConfigChange.deleted(bean));
}
fire(changes);
} | java | public final void fireDelete(List<Bean> beans) {
ConfigChanges changes = new ConfigChanges();
for (Bean bean : beans) {
changes.add(ConfigChange.deleted(bean));
}
fire(changes);
} | [
"public",
"final",
"void",
"fireDelete",
"(",
"List",
"<",
"Bean",
">",
"beans",
")",
"{",
"ConfigChanges",
"changes",
"=",
"new",
"ConfigChanges",
"(",
")",
";",
"for",
"(",
"Bean",
"bean",
":",
"beans",
")",
"{",
"changes",
".",
"add",
"(",
"ConfigCh... | Fire a notification for a collection of beans that have been deleted.
@param beans deleted beans | [
"Fire",
"a",
"notification",
"for",
"a",
"collection",
"of",
"beans",
"that",
"have",
"been",
"deleted",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java#L100-L106 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java | NotificationManager.updated | public final ConfigChanges updated(Collection<Bean> after) {
ConfigChanges changes = new ConfigChanges();
for (Bean bean : after) {
Optional<Bean> optional = beanManager.getEager(bean.getId());
if (!optional.isPresent()) {
throw Events.CFG304_BEAN_DOESNT_EXIST(bea... | java | public final ConfigChanges updated(Collection<Bean> after) {
ConfigChanges changes = new ConfigChanges();
for (Bean bean : after) {
Optional<Bean> optional = beanManager.getEager(bean.getId());
if (!optional.isPresent()) {
throw Events.CFG304_BEAN_DOESNT_EXIST(bea... | [
"public",
"final",
"ConfigChanges",
"updated",
"(",
"Collection",
"<",
"Bean",
">",
"after",
")",
"{",
"ConfigChanges",
"changes",
"=",
"new",
"ConfigChanges",
"(",
")",
";",
"for",
"(",
"Bean",
"bean",
":",
"after",
")",
"{",
"Optional",
"<",
"Bean",
">... | Create a changes object from an update operation.
@param after state after the update have been made
@return changes object | [
"Create",
"a",
"changes",
"object",
"from",
"an",
"update",
"operation",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/NotificationManager.java#L114-L126 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/Parser.java | Parser.parsePathExpression | private static Path parsePathExpression(Iterator<Token> expression,
ConfigOrigin origin, String originalText) {
// each builder in "buf" is an element in the path.
List<Element> buf = new ArrayList<Element>();
buf.add(new Element("", false));
if (!expression.hasNext()) {
... | java | private static Path parsePathExpression(Iterator<Token> expression,
ConfigOrigin origin, String originalText) {
// each builder in "buf" is an element in the path.
List<Element> buf = new ArrayList<Element>();
buf.add(new Element("", false));
if (!expression.hasNext()) {
... | [
"private",
"static",
"Path",
"parsePathExpression",
"(",
"Iterator",
"<",
"Token",
">",
"expression",
",",
"ConfigOrigin",
"origin",
",",
"String",
"originalText",
")",
"{",
"// each builder in \"buf\" is an element in the path.",
"List",
"<",
"Element",
">",
"buf",
"... | originalText may be null if not available | [
"originalText",
"may",
"be",
"null",
"if",
"not",
"available"
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/Parser.java#L894-L961 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/Parser.java | Parser.hasUnsafeChars | private static boolean hasUnsafeChars(String s) {
for (int i = 0; i < s.length(); ++i) {
char c = s.charAt(i);
if (Character.isLetter(c) || c == '.')
continue;
else
return true;
}
return false;
} | java | private static boolean hasUnsafeChars(String s) {
for (int i = 0; i < s.length(); ++i) {
char c = s.charAt(i);
if (Character.isLetter(c) || c == '.')
continue;
else
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"hasUnsafeChars",
"(",
"String",
"s",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"++",
"i",
")",
"{",
"char",
"c",
"=",
"s",
".",
"charAt",
"(",
"i",
")",
";",... | full parser to deal with. | [
"full",
"parser",
"to",
"deal",
"with",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/Parser.java#L984-L993 | train |
deephacks/confit | provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/Bytes.java | Bytes.setShort | public static void setShort(final byte[] b, final short n, final int offset) {
b[offset + 0] = (byte) (n >>> 8);
b[offset + 1] = (byte) (n >>> 0);
} | java | public static void setShort(final byte[] b, final short n, final int offset) {
b[offset + 0] = (byte) (n >>> 8);
b[offset + 1] = (byte) (n >>> 0);
} | [
"public",
"static",
"void",
"setShort",
"(",
"final",
"byte",
"[",
"]",
"b",
",",
"final",
"short",
"n",
",",
"final",
"int",
"offset",
")",
"{",
"b",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"n",
">>>",
"8",
")",
";",
"b",
"... | Writes a big-endian 2-byte short at an offset in the given array.
@param b The array to write to.
@param offset The offset in the array to start writing at.
@throws IndexOutOfBoundsException if the byte array is too small. | [
"Writes",
"a",
"big",
"-",
"endian",
"2",
"-",
"byte",
"short",
"at",
"an",
"offset",
"in",
"the",
"given",
"array",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/Bytes.java#L108-L111 | train |
deephacks/confit | provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/Bytes.java | Bytes.setInt | public static void setInt(final byte[] b, final int n, final int offset) {
b[offset + 0] = (byte) (n >>> 24);
b[offset + 1] = (byte) (n >>> 16);
b[offset + 2] = (byte) (n >>> 8);
b[offset + 3] = (byte) (n >>> 0);
} | java | public static void setInt(final byte[] b, final int n, final int offset) {
b[offset + 0] = (byte) (n >>> 24);
b[offset + 1] = (byte) (n >>> 16);
b[offset + 2] = (byte) (n >>> 8);
b[offset + 3] = (byte) (n >>> 0);
} | [
"public",
"static",
"void",
"setInt",
"(",
"final",
"byte",
"[",
"]",
"b",
",",
"final",
"int",
"n",
",",
"final",
"int",
"offset",
")",
"{",
"b",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"n",
">>>",
"24",
")",
";",
"b",
"[",... | Writes a big-endian 4-byte int at an offset in the given array.
@param b The array to write to.
@param offset The offset in the array to start writing at.
@throws IndexOutOfBoundsException if the byte array is too small. | [
"Writes",
"a",
"big",
"-",
"endian",
"4",
"-",
"byte",
"int",
"at",
"an",
"offset",
"in",
"the",
"given",
"array",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/Bytes.java#L185-L190 | train |
deephacks/confit | provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/Bytes.java | Bytes.setLong | public static void setLong(final byte[] b, final long n, final int offset) {
b[offset + 0] = (byte) (n >>> 56);
b[offset + 1] = (byte) (n >>> 48);
b[offset + 2] = (byte) (n >>> 40);
b[offset + 3] = (byte) (n >>> 32);
b[offset + 4] = (byte) (n >>> 24);
b[offset + 5] = (byt... | java | public static void setLong(final byte[] b, final long n, final int offset) {
b[offset + 0] = (byte) (n >>> 56);
b[offset + 1] = (byte) (n >>> 48);
b[offset + 2] = (byte) (n >>> 40);
b[offset + 3] = (byte) (n >>> 32);
b[offset + 4] = (byte) (n >>> 24);
b[offset + 5] = (byt... | [
"public",
"static",
"void",
"setLong",
"(",
"final",
"byte",
"[",
"]",
"b",
",",
"final",
"long",
"n",
",",
"final",
"int",
"offset",
")",
"{",
"b",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"n",
">>>",
"56",
")",
";",
"b",
"[... | Writes a big-endian 8-byte long at an offset in the given array.
@param b The array to write to.
@param offset The offset in the array to start writing at.
@throws IndexOutOfBoundsException if the byte array is too small. | [
"Writes",
"a",
"big",
"-",
"endian",
"8",
"-",
"byte",
"long",
"at",
"an",
"offset",
"in",
"the",
"given",
"array",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase-filter/src/main/java/org/deephacks/confit/internal/hbase/Bytes.java#L243-L252 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRowCollector.java | HBeanRowCollector.filterUnvisted | public Set<HBeanRow> filterUnvisted(Set<HBeanRow> rows) {
Set<HBeanRow> unvisted = new HashSet<>();
for (HBeanRow row : rows) {
if (!references.containsKey(row) && !inital.containsKey(row)) {
unvisted.add(row);
}
}
return unvisted;
} | java | public Set<HBeanRow> filterUnvisted(Set<HBeanRow> rows) {
Set<HBeanRow> unvisted = new HashSet<>();
for (HBeanRow row : rows) {
if (!references.containsKey(row) && !inital.containsKey(row)) {
unvisted.add(row);
}
}
return unvisted;
} | [
"public",
"Set",
"<",
"HBeanRow",
">",
"filterUnvisted",
"(",
"Set",
"<",
"HBeanRow",
">",
"rows",
")",
"{",
"Set",
"<",
"HBeanRow",
">",
"unvisted",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"HBeanRow",
"row",
":",
"rows",
")",
"{",
... | Filter out the rows that we have not yet visited. | [
"Filter",
"out",
"the",
"rows",
"that",
"we",
"have",
"not",
"yet",
"visited",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRowCollector.java#L56-L64 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRowCollector.java | HBeanRowCollector.getBeans | public List<Bean> getBeans() {
Map<BeanId, Bean> referenceMap = new HashMap<>();
List<Bean> result = new ArrayList<>();
for (HBeanRow row : inital.keySet()) {
Bean bean = row.getBean();
result.add(bean);
referenceMap.put(bean.getId(), bean);
}
... | java | public List<Bean> getBeans() {
Map<BeanId, Bean> referenceMap = new HashMap<>();
List<Bean> result = new ArrayList<>();
for (HBeanRow row : inital.keySet()) {
Bean bean = row.getBean();
result.add(bean);
referenceMap.put(bean.getId(), bean);
}
... | [
"public",
"List",
"<",
"Bean",
">",
"getBeans",
"(",
")",
"{",
"Map",
"<",
"BeanId",
",",
"Bean",
">",
"referenceMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"List",
"<",
"Bean",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"... | Convert the collected rows into a hierarchy of beans where
list references are initalized. | [
"Convert",
"the",
"collected",
"rows",
"into",
"a",
"hierarchy",
"of",
"beans",
"where",
"list",
"references",
"are",
"initalized",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRowCollector.java#L70-L90 | train |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/utils/PGPKeyValidator.java | PGPKeyValidator.validatePublicKey | public static void validatePublicKey(String value, PublicKeyCrypto crypto) throws BadPublicKeyException {
if (org.springframework.util.StringUtils.hasText(value)) {
int open = value.indexOf("-----BEGIN PGP PUBLIC KEY BLOCK-----");
int close = value.indexOf("-----END PGP PUBLIC KEY BLOCK-... | java | public static void validatePublicKey(String value, PublicKeyCrypto crypto) throws BadPublicKeyException {
if (org.springframework.util.StringUtils.hasText(value)) {
int open = value.indexOf("-----BEGIN PGP PUBLIC KEY BLOCK-----");
int close = value.indexOf("-----END PGP PUBLIC KEY BLOCK-... | [
"public",
"static",
"void",
"validatePublicKey",
"(",
"String",
"value",
",",
"PublicKeyCrypto",
"crypto",
")",
"throws",
"BadPublicKeyException",
"{",
"if",
"(",
"org",
".",
"springframework",
".",
"util",
".",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
... | Validates a PGP public key.
@param value value to validate
@param crypto crypto implementation to carry out additional checks
@throws BadPublicKeyException thrown if validation fails; getMessage()
contains error code | [
"Validates",
"a",
"PGP",
"public",
"key",
"."
] | 4cad6d0f8e951a61f3c302c49b13a51d179076f8 | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/utils/PGPKeyValidator.java#L20-L38 | train |
deephacks/confit | provider-yaml/src/main/java/org/deephacks/confit/internal/core/yaml/YamlBeanManager.java | YamlBeanManager.hasReferences | private static boolean hasReferences(Bean target, BeanId reference) {
for (String name : target.getReferenceNames()) {
for (BeanId ref : target.getReference(name)) {
if (ref.equals(reference)) {
return true;
}
}
}
return... | java | private static boolean hasReferences(Bean target, BeanId reference) {
for (String name : target.getReferenceNames()) {
for (BeanId ref : target.getReference(name)) {
if (ref.equals(reference)) {
return true;
}
}
}
return... | [
"private",
"static",
"boolean",
"hasReferences",
"(",
"Bean",
"target",
",",
"BeanId",
"reference",
")",
"{",
"for",
"(",
"String",
"name",
":",
"target",
".",
"getReferenceNames",
"(",
")",
")",
"{",
"for",
"(",
"BeanId",
"ref",
":",
"target",
".",
"get... | Returns the a list of property names of the target bean that have
references to the bean id. | [
"Returns",
"the",
"a",
"list",
"of",
"property",
"names",
"of",
"the",
"target",
"bean",
"that",
"have",
"references",
"to",
"the",
"bean",
"id",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-yaml/src/main/java/org/deephacks/confit/internal/core/yaml/YamlBeanManager.java#L443-L452 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java | HBeanRow.getId | public static long getId(final byte[] rowkey) {
return (rowkey[0] & 0xFFL) << 40 | (rowkey[1] & 0xFFL) << 32 | (rowkey[2] & 0xFFL) << 24
| (rowkey[3] & 0xFFL) << 16 | (rowkey[4] & 0xFFL) << 8 | (rowkey[5] & 0xFFL) << 0;
} | java | public static long getId(final byte[] rowkey) {
return (rowkey[0] & 0xFFL) << 40 | (rowkey[1] & 0xFFL) << 32 | (rowkey[2] & 0xFFL) << 24
| (rowkey[3] & 0xFFL) << 16 | (rowkey[4] & 0xFFL) << 8 | (rowkey[5] & 0xFFL) << 0;
} | [
"public",
"static",
"long",
"getId",
"(",
"final",
"byte",
"[",
"]",
"rowkey",
")",
"{",
"return",
"(",
"rowkey",
"[",
"0",
"]",
"&",
"0xFF",
"L",
")",
"<<",
"40",
"|",
"(",
"rowkey",
"[",
"1",
"]",
"&",
"0xFF",
"L",
")",
"<<",
"32",
"|",
"("... | Convert the row key to a long id.
@param rowkey 6 byte row key.
@return long representation of the row key. | [
"Convert",
"the",
"row",
"key",
"to",
"a",
"long",
"id",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java#L165-L168 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java | HBeanRow.getRowKey | private static byte[] getRowKey(long id) {
final byte[] b = new byte[6];
b[0] = (byte) (id >>> 40);
b[1] = (byte) (id >>> 32);
b[2] = (byte) (id >>> 24);
b[3] = (byte) (id >>> 16);
b[4] = (byte) (id >>> 8);
b[5] = (byte) (id >>> 0);
return b;
} | java | private static byte[] getRowKey(long id) {
final byte[] b = new byte[6];
b[0] = (byte) (id >>> 40);
b[1] = (byte) (id >>> 32);
b[2] = (byte) (id >>> 24);
b[3] = (byte) (id >>> 16);
b[4] = (byte) (id >>> 8);
b[5] = (byte) (id >>> 0);
return b;
} | [
"private",
"static",
"byte",
"[",
"]",
"getRowKey",
"(",
"long",
"id",
")",
"{",
"final",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"6",
"]",
";",
"b",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"id",
">>>",
"40",
")",
";",
"b",
"[",
... | The bean rowkey is stored as 6 bytes, but it is represented as a big-endian
8-byte long. | [
"The",
"bean",
"rowkey",
"is",
"stored",
"as",
"6",
"bytes",
"but",
"it",
"is",
"represented",
"as",
"a",
"big",
"-",
"endian",
"8",
"-",
"byte",
"long",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java#L213-L222 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java | HBeanRow.getRowKey | public static byte[] getRowKey(final BeanId id, final UniqueIds uids) {
final byte[] iid = uids.getUiid().getId(id.getInstanceId());
final byte[] sid = uids.getUsid().getId(id.getSchemaName());
final byte[] rowkey = new byte[sid.length + iid.length];
System.arraycopy(sid, 0, rowkey, 0, s... | java | public static byte[] getRowKey(final BeanId id, final UniqueIds uids) {
final byte[] iid = uids.getUiid().getId(id.getInstanceId());
final byte[] sid = uids.getUsid().getId(id.getSchemaName());
final byte[] rowkey = new byte[sid.length + iid.length];
System.arraycopy(sid, 0, rowkey, 0, s... | [
"public",
"static",
"byte",
"[",
"]",
"getRowKey",
"(",
"final",
"BeanId",
"id",
",",
"final",
"UniqueIds",
"uids",
")",
"{",
"final",
"byte",
"[",
"]",
"iid",
"=",
"uids",
".",
"getUiid",
"(",
")",
".",
"getId",
"(",
"id",
".",
"getInstanceId",
"(",... | Get the hbase rowkey of some bean id. | [
"Get",
"the",
"hbase",
"rowkey",
"of",
"some",
"bean",
"id",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java#L227-L234 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java | HBeanRow.setColumnFilter | public static void setColumnFilter(Object op, FetchType... column) {
ArrayList<byte[]> columns = new ArrayList<>();
columns.add(DUMMY_COLUMN_FAMILY);
if (column.length == 0) {
// default behaviour
columns.add(PROP_COLUMN_FAMILY);
columns.add(PRED_COLUMN_FAMILY... | java | public static void setColumnFilter(Object op, FetchType... column) {
ArrayList<byte[]> columns = new ArrayList<>();
columns.add(DUMMY_COLUMN_FAMILY);
if (column.length == 0) {
// default behaviour
columns.add(PROP_COLUMN_FAMILY);
columns.add(PRED_COLUMN_FAMILY... | [
"public",
"static",
"void",
"setColumnFilter",
"(",
"Object",
"op",
",",
"FetchType",
"...",
"column",
")",
"{",
"ArrayList",
"<",
"byte",
"[",
"]",
">",
"columns",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"columns",
".",
"add",
"(",
"DUMMY_COLUMN_F... | Add column filter based fetch type on operation Get or Scan. | [
"Add",
"column",
"filter",
"based",
"fetch",
"type",
"on",
"operation",
"Get",
"or",
"Scan",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanRow.java#L393-L420 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/serialization/Conversion.java | Conversion.convert | public <T> T convert(final Object source, final Class<T> targetclass) {
if (source == null) {
return null;
}
final Class<?> sourceclass = source.getClass();
if (targetclass.isPrimitive() && String.class.isAssignableFrom(sourceclass)) {
return (T) parsePrimitive(s... | java | public <T> T convert(final Object source, final Class<T> targetclass) {
if (source == null) {
return null;
}
final Class<?> sourceclass = source.getClass();
if (targetclass.isPrimitive() && String.class.isAssignableFrom(sourceclass)) {
return (T) parsePrimitive(s... | [
"public",
"<",
"T",
">",
"T",
"convert",
"(",
"final",
"Object",
"source",
",",
"final",
"Class",
"<",
"T",
">",
"targetclass",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Class",
"<",
"?",
">",
"s... | Convert a value to a specific class.
The algorithm for finding a suitable converter is as follows:
Find converters that is able to convert both source and target; a exact or
superclass match. Pick the converter that have the best target match, if both
are equal, pick the one with best source match.
That is, the conv... | [
"Convert",
"a",
"value",
"to",
"a",
"specific",
"class",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/serialization/Conversion.java#L92-L128 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/admin/AdminCoreContext.java | AdminCoreContext.findReferences | private List<Bean> findReferences(BeanId reference, Collection<Bean> predecessors,
ArrayList<Bean> matches, ArrayList<Bean> checked) {
for (Bean predecessor : predecessors) {
findReferences(reference, predecessor, matches, checked);
}
return matches;
} | java | private List<Bean> findReferences(BeanId reference, Collection<Bean> predecessors,
ArrayList<Bean> matches, ArrayList<Bean> checked) {
for (Bean predecessor : predecessors) {
findReferences(reference, predecessor, matches, checked);
}
return matches;
} | [
"private",
"List",
"<",
"Bean",
">",
"findReferences",
"(",
"BeanId",
"reference",
",",
"Collection",
"<",
"Bean",
">",
"predecessors",
",",
"ArrayList",
"<",
"Bean",
">",
"matches",
",",
"ArrayList",
"<",
"Bean",
">",
"checked",
")",
"{",
"for",
"(",
"B... | Does a recursive check if predecessor have a particular reference and if
so return those predecessor references. | [
"Does",
"a",
"recursive",
"check",
"if",
"predecessor",
"have",
"a",
"particular",
"reference",
"and",
"if",
"so",
"return",
"those",
"predecessor",
"references",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/admin/AdminCoreContext.java#L377-L384 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/admin/AdminCoreContext.java | AdminCoreContext.initalizeReferences | @SuppressWarnings("unused")
private void initalizeReferences(Collection<Bean> beans) {
Map<BeanId, Bean> userProvided = BeanUtils.uniqueIndex(beans);
for (Bean bean : beans) {
for (String name : bean.getReferenceNames()) {
List<BeanId> values = bean.getReference(name);
... | java | @SuppressWarnings("unused")
private void initalizeReferences(Collection<Bean> beans) {
Map<BeanId, Bean> userProvided = BeanUtils.uniqueIndex(beans);
for (Bean bean : beans) {
for (String name : bean.getReferenceNames()) {
List<BeanId> values = bean.getReference(name);
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"initalizeReferences",
"(",
"Collection",
"<",
"Bean",
">",
"beans",
")",
"{",
"Map",
"<",
"BeanId",
",",
"Bean",
">",
"userProvided",
"=",
"BeanUtils",
".",
"uniqueIndex",
"(",
"beans",
")"... | Used for setting or creating a multiple beans.
We must consider that the operation may include beans that have
references betewen eachother. User provided beans are
prioritized and the storage is secondary for looking up references. | [
"Used",
"for",
"setting",
"or",
"creating",
"a",
"multiple",
"beans",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/admin/AdminCoreContext.java#L453-L477 | train |
jbossws/jbossws-common-tools | src/main/java/org/jboss/ws/tools/ant/InstallModulesTask.java | InstallModulesTask.execute | @Override
public void execute() throws BuildException
{
try
{
DirectoryScanner dsc = fileset.getDirectoryScanner(getProject());
File baseDir = dsc.getBasedir();
String[] files = dsc.getIncludedFiles();
for (int i = 0; i < files.length; i++)
{
St... | java | @Override
public void execute() throws BuildException
{
try
{
DirectoryScanner dsc = fileset.getDirectoryScanner(getProject());
File baseDir = dsc.getBasedir();
String[] files = dsc.getIncludedFiles();
for (int i = 0; i < files.length; i++)
{
St... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"BuildException",
"{",
"try",
"{",
"DirectoryScanner",
"dsc",
"=",
"fileset",
".",
"getDirectoryScanner",
"(",
"getProject",
"(",
")",
")",
";",
"File",
"baseDir",
"=",
"dsc",
".",
"getBasedir... | the fileset of module.xml files to be processed | [
"the",
"fileset",
"of",
"module",
".",
"xml",
"files",
"to",
"be",
"processed"
] | d05ad85663d706e5f0d634f2f8ca6665a6147b3e | https://github.com/jbossws/jbossws-common-tools/blob/d05ad85663d706e5f0d634f2f8ca6665a6147b3e/src/main/java/org/jboss/ws/tools/ant/InstallModulesTask.java#L51-L99 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBean.java | JpaBean.getBeanToValidate | public static Set<Bean> getBeanToValidate(Set<BeanId> ids) {
List<JpaRef> targetPredecessors = JpaRef.getDirectPredecessors(ids);
Set<BeanId> beansToValidate = new HashSet<>();
for (JpaRef ref : targetPredecessors) {
beansToValidate.add(ref.getSource());
}
beans... | java | public static Set<Bean> getBeanToValidate(Set<BeanId> ids) {
List<JpaRef> targetPredecessors = JpaRef.getDirectPredecessors(ids);
Set<BeanId> beansToValidate = new HashSet<>();
for (JpaRef ref : targetPredecessors) {
beansToValidate.add(ref.getSource());
}
beans... | [
"public",
"static",
"Set",
"<",
"Bean",
">",
"getBeanToValidate",
"(",
"Set",
"<",
"BeanId",
">",
"ids",
")",
"{",
"List",
"<",
"JpaRef",
">",
"targetPredecessors",
"=",
"JpaRef",
".",
"getDirectPredecessors",
"(",
"ids",
")",
";",
"Set",
"<",
"BeanId",
... | Will return the target bean and its direct predecessors for validation | [
"Will",
"return",
"the",
"target",
"bean",
"and",
"its",
"direct",
"predecessors",
"for",
"validation"
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBean.java#L154-L167 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBean.java | JpaBean.getJpaBeanAndProperties | @SuppressWarnings("unused")
private static JpaBean getJpaBeanAndProperties(BeanId id) {
List<JpaProperty> props = JpaProperty.findProperties(id);
if (props.size() == 0) {
// no marker, bean does not exist
return null;
}
JpaBean bean = new JpaBean(new Jp... | java | @SuppressWarnings("unused")
private static JpaBean getJpaBeanAndProperties(BeanId id) {
List<JpaProperty> props = JpaProperty.findProperties(id);
if (props.size() == 0) {
// no marker, bean does not exist
return null;
}
JpaBean bean = new JpaBean(new Jp... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"static",
"JpaBean",
"getJpaBeanAndProperties",
"(",
"BeanId",
"id",
")",
"{",
"List",
"<",
"JpaProperty",
">",
"props",
"=",
"JpaProperty",
".",
"findProperties",
"(",
"id",
")",
";",
"if",
"(",
"p... | Need not consult the JpaBean table since the property marker
in JpaProperties table is an indicator that the JpaBean really
exist, even if it has no properties. | [
"Need",
"not",
"consult",
"the",
"JpaBean",
"table",
"since",
"the",
"property",
"marker",
"in",
"JpaProperties",
"table",
"is",
"an",
"indicator",
"that",
"the",
"JpaBean",
"really",
"exist",
"even",
"if",
"it",
"has",
"no",
"properties",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBean.java#L189-L200 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/ConfigConcatenation.java | ConfigConcatenation.join | private static void join(ArrayList<AbstractConfigValue> builder, AbstractConfigValue origRight) {
AbstractConfigValue left = builder.get(builder.size() - 1);
AbstractConfigValue right = origRight;
// check for an object which can be converted to a list
// (this will be an object with nu... | java | private static void join(ArrayList<AbstractConfigValue> builder, AbstractConfigValue origRight) {
AbstractConfigValue left = builder.get(builder.size() - 1);
AbstractConfigValue right = origRight;
// check for an object which can be converted to a list
// (this will be an object with nu... | [
"private",
"static",
"void",
"join",
"(",
"ArrayList",
"<",
"AbstractConfigValue",
">",
"builder",
",",
"AbstractConfigValue",
"origRight",
")",
"{",
"AbstractConfigValue",
"left",
"=",
"builder",
".",
"get",
"(",
"builder",
".",
"size",
"(",
")",
"-",
"1",
... | Add left and right, or their merger, to builder. | [
"Add",
"left",
"and",
"right",
"or",
"their",
"merger",
"to",
"builder",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/ConfigConcatenation.java#L89-L134 | train |
payneteasy/superfly | superfly-service/src/main/java/com/payneteasy/superfly/email/impl/VelocityEngineUtils.java | VelocityEngineUtils.mergeTemplate | public static void mergeTemplate(
VelocityEngine velocityEngine, String templateLocation, String encoding,
Map<String, Object> model, Writer writer) throws VelocityException {
VelocityContext velocityContext = new VelocityContext(model);
velocityEngine.mergeTemplate(templateLocation, encoding, velocityContex... | java | public static void mergeTemplate(
VelocityEngine velocityEngine, String templateLocation, String encoding,
Map<String, Object> model, Writer writer) throws VelocityException {
VelocityContext velocityContext = new VelocityContext(model);
velocityEngine.mergeTemplate(templateLocation, encoding, velocityContex... | [
"public",
"static",
"void",
"mergeTemplate",
"(",
"VelocityEngine",
"velocityEngine",
",",
"String",
"templateLocation",
",",
"String",
"encoding",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
",",
"Writer",
"writer",
")",
"throws",
"VelocityException",... | Merge the specified Velocity template with the given model and write the result
to the given Writer.
@param velocityEngine VelocityEngine to work with
@param templateLocation the location of template, relative to Velocity's resource loader path
@param encoding the encoding of the template file
@param model the Map that... | [
"Merge",
"the",
"specified",
"Velocity",
"template",
"with",
"the",
"given",
"model",
"and",
"write",
"the",
"result",
"to",
"the",
"given",
"Writer",
"."
] | 4cad6d0f8e951a61f3c302c49b13a51d179076f8 | https://github.com/payneteasy/superfly/blob/4cad6d0f8e951a61f3c302c49b13a51d179076f8/superfly-service/src/main/java/com/payneteasy/superfly/email/impl/VelocityEngineUtils.java#L67-L73 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/SimpleConfig.java | SimpleConfig.parseDuration | public static long parseDuration(String input,
ConfigOrigin originForException, String pathForException) {
String s = ConfigImplUtil.unicodeTrim(input);
String originalUnitString = getUnits(s);
String unitString = originalUnitString;
String numberString = ConfigImplUtil.unico... | java | public static long parseDuration(String input,
ConfigOrigin originForException, String pathForException) {
String s = ConfigImplUtil.unicodeTrim(input);
String originalUnitString = getUnits(s);
String unitString = originalUnitString;
String numberString = ConfigImplUtil.unico... | [
"public",
"static",
"long",
"parseDuration",
"(",
"String",
"input",
",",
"ConfigOrigin",
"originForException",
",",
"String",
"pathForException",
")",
"{",
"String",
"s",
"=",
"ConfigImplUtil",
".",
"unicodeTrim",
"(",
"input",
")",
";",
"String",
"originalUnitSt... | Parses a duration string. If no units are specified in the string, it is
assumed to be in milliseconds. The returned duration is in nanoseconds.
The purpose of this function is to implement the duration-related methods
in the ConfigObject interface.
@param input
the string to parse
@param originForException
origin of ... | [
"Parses",
"a",
"duration",
"string",
".",
"If",
"no",
"units",
"are",
"specified",
"in",
"the",
"string",
"it",
"is",
"assumed",
"to",
"be",
"in",
"milliseconds",
".",
"The",
"returned",
"duration",
"is",
"in",
"nanoseconds",
".",
"The",
"purpose",
"of",
... | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/SimpleConfig.java#L495-L552 | train |
deephacks/confit | api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java | ConfigQueryBuilder.in | public static Restriction in(String property, Object... values) {
return new In(property, Arrays.asList(values));
} | java | public static Restriction in(String property, Object... values) {
return new In(property, Arrays.asList(values));
} | [
"public",
"static",
"Restriction",
"in",
"(",
"String",
"property",
",",
"Object",
"...",
"values",
")",
"{",
"return",
"new",
"In",
"(",
"property",
",",
"Arrays",
".",
"asList",
"(",
"values",
")",
")",
";",
"}"
] | A shorthand way to create an OR query comprised of several equal queries.
@param property field to query
@param values value to query for
@return restriction to be added to {@link ConfigQuery}. | [
"A",
"shorthand",
"way",
"to",
"create",
"an",
"OR",
"query",
"comprised",
"of",
"several",
"equal",
"queries",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java#L91-L93 | train |
deephacks/confit | api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java | ConfigQueryBuilder.and | public static Restriction and(Restriction r1, Restriction r2) {
return new And(Arrays.asList(r1, r2));
} | java | public static Restriction and(Restriction r1, Restriction r2) {
return new And(Arrays.asList(r1, r2));
} | [
"public",
"static",
"Restriction",
"and",
"(",
"Restriction",
"r1",
",",
"Restriction",
"r2",
")",
"{",
"return",
"new",
"And",
"(",
"Arrays",
".",
"asList",
"(",
"r1",
",",
"r2",
")",
")",
";",
"}"
] | A query representing a logical AND of the provided restrictions.
s
@param r1 Restriction one
@param r2 Restriction two
@return An AND restriction. | [
"A",
"query",
"representing",
"a",
"logical",
"AND",
"of",
"the",
"provided",
"restrictions",
".",
"s"
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java#L102-L104 | train |
deephacks/confit | api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java | ConfigQueryBuilder.or | public static Restriction or(Restriction r1, Restriction r2) {
return new Or(Arrays.asList(r1, r2));
} | java | public static Restriction or(Restriction r1, Restriction r2) {
return new Or(Arrays.asList(r1, r2));
} | [
"public",
"static",
"Restriction",
"or",
"(",
"Restriction",
"r1",
",",
"Restriction",
"r2",
")",
"{",
"return",
"new",
"Or",
"(",
"Arrays",
".",
"asList",
"(",
"r1",
",",
"r2",
")",
")",
";",
"}"
] | A restriction representing a logical OR of the provided restrictions.
s
@param r1 Restriction one
@param r2 Restriction two
@return An OR restriction. | [
"A",
"restriction",
"representing",
"a",
"logical",
"OR",
"of",
"the",
"provided",
"restrictions",
".",
"s"
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java#L113-L115 | train |
rynr/launchpad | src/main/java/org/rjung/util/launchpad/Launchpad.java | Launchpad.send | @Override
public void send(MidiMessage message, long timeStamp) {
if (this.launchpadReceiver != null && message instanceof ShortMessage) {
ShortMessage sm = (ShortMessage) message;
Pad pad = Pad.findMidi(sm);
if (pad != null) {
this.launchpadReceiver.receive(pad);
}
}
} | java | @Override
public void send(MidiMessage message, long timeStamp) {
if (this.launchpadReceiver != null && message instanceof ShortMessage) {
ShortMessage sm = (ShortMessage) message;
Pad pad = Pad.findMidi(sm);
if (pad != null) {
this.launchpadReceiver.receive(pad);
}
}
} | [
"@",
"Override",
"public",
"void",
"send",
"(",
"MidiMessage",
"message",
",",
"long",
"timeStamp",
")",
"{",
"if",
"(",
"this",
".",
"launchpadReceiver",
"!=",
"null",
"&&",
"message",
"instanceof",
"ShortMessage",
")",
"{",
"ShortMessage",
"sm",
"=",
"(",
... | Please do not use this method. It's the internal implementation to receive midi commands. | [
"Please",
"do",
"not",
"use",
"this",
"method",
".",
"It",
"s",
"the",
"internal",
"implementation",
"to",
"receive",
"midi",
"commands",
"."
] | 15460e2df0aaafacfbcc529d0e8c68ee48b0980b | https://github.com/rynr/launchpad/blob/15460e2df0aaafacfbcc529d0e8c68ee48b0980b/src/main/java/org/rjung/util/launchpad/Launchpad.java#L99-L108 | train |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/MemoryFileSystem.java | MemoryFileSystem.getEntriesList | private synchronized List<Entry> getEntriesList( DirectoryEntry directory )
{
List<Entry> entries = contents.get( directory );
if ( entries == null )
{
entries = new ArrayList<Entry>();
contents.put( directory, entries );
}
return entries;
} | java | private synchronized List<Entry> getEntriesList( DirectoryEntry directory )
{
List<Entry> entries = contents.get( directory );
if ( entries == null )
{
entries = new ArrayList<Entry>();
contents.put( directory, entries );
}
return entries;
} | [
"private",
"synchronized",
"List",
"<",
"Entry",
">",
"getEntriesList",
"(",
"DirectoryEntry",
"directory",
")",
"{",
"List",
"<",
"Entry",
">",
"entries",
"=",
"contents",
".",
"get",
"(",
"directory",
")",
";",
"if",
"(",
"entries",
"==",
"null",
")",
... | Gets the list of entries in the specified directory.
@param directory the directory to get the entries of.
@return the list of entries (never <code>null</code>).
@since 1.0 | [
"Gets",
"the",
"list",
"of",
"entries",
"in",
"the",
"specified",
"directory",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/MemoryFileSystem.java#L191-L200 | train |
deephacks/confit | provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java | ConfigReferenceHolder.getObjectReference | public Object getObjectReference(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
String instanceId = instanceIds.get(0);
if(instanceId == null) {
retur... | java | public Object getObjectReference(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
String instanceId = instanceIds.get(0);
if(instanceId == null) {
retur... | [
"public",
"Object",
"getObjectReference",
"(",
"String",
"field",
",",
"String",
"schemaName",
")",
"{",
"List",
"<",
"String",
">",
"instanceIds",
"=",
"references",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"instanceIds",
"==",
"null",
"||",
"instan... | '
Called by a proxy to lookup single object reference. The proxy knows
the schema name so the hold does not need to bother storing it. | [
"Called",
"by",
"a",
"proxy",
"to",
"lookup",
"single",
"object",
"reference",
".",
"The",
"proxy",
"knows",
"the",
"schema",
"name",
"so",
"the",
"hold",
"does",
"not",
"need",
"to",
"bother",
"storing",
"it",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java#L67-L84 | train |
deephacks/confit | provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java | ConfigReferenceHolder.getObjectReferenceList | public Collection<Object> getObjectReferenceList(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
List<Object> objects = new ArrayList<>();
for (String instanceId :... | java | public Collection<Object> getObjectReferenceList(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
List<Object> objects = new ArrayList<>();
for (String instanceId :... | [
"public",
"Collection",
"<",
"Object",
">",
"getObjectReferenceList",
"(",
"String",
"field",
",",
"String",
"schemaName",
")",
"{",
"List",
"<",
"String",
">",
"instanceIds",
"=",
"references",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"instanceIds",
... | '
Called by a proxy to lookup a list of object references. The proxy knows
the schema name so the hold does not need to bother storing it. | [
"Called",
"by",
"a",
"proxy",
"to",
"lookup",
"a",
"list",
"of",
"object",
"references",
".",
"The",
"proxy",
"knows",
"the",
"schema",
"name",
"so",
"the",
"hold",
"does",
"not",
"need",
"to",
"bother",
"storing",
"it",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java#L90-L108 | train |
deephacks/confit | provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java | ConfigReferenceHolder.getObjectReferenceMap | public Map<String, Object> getObjectReferenceMap(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
Map<String, Object> objects = new HashMap<>();
for (String instanc... | java | public Map<String, Object> getObjectReferenceMap(String field, String schemaName) {
List<String> instanceIds = references.get(field);
if(instanceIds == null || instanceIds.size() == 0) {
return null;
}
Map<String, Object> objects = new HashMap<>();
for (String instanc... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getObjectReferenceMap",
"(",
"String",
"field",
",",
"String",
"schemaName",
")",
"{",
"List",
"<",
"String",
">",
"instanceIds",
"=",
"references",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"inst... | '
Called by a proxy to lookup a map of object references. The proxy knows
the schema name so the hold does not need to bother storing it. | [
"Called",
"by",
"a",
"proxy",
"to",
"lookup",
"a",
"map",
"of",
"object",
"references",
".",
"The",
"proxy",
"knows",
"the",
"schema",
"name",
"so",
"the",
"hold",
"does",
"not",
"need",
"to",
"bother",
"storing",
"it",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-cached/src/main/java/org/deephacks/confit/internal/cached/proxy/ConfigReferenceHolder.java#L114-L132 | train |
jbossws/jbossws-common-tools | src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java | AntTaskHelper.toSystemProperties | static SysProperties toSystemProperties(final String[] arguments)
{
final SysProperties retVal = new SysProperties();
if (arguments != null && arguments.length != 0)
{
for (final String argument : arguments)
{
if (argument.startsWith("-D"))
{
... | java | static SysProperties toSystemProperties(final String[] arguments)
{
final SysProperties retVal = new SysProperties();
if (arguments != null && arguments.length != 0)
{
for (final String argument : arguments)
{
if (argument.startsWith("-D"))
{
... | [
"static",
"SysProperties",
"toSystemProperties",
"(",
"final",
"String",
"[",
"]",
"arguments",
")",
"{",
"final",
"SysProperties",
"retVal",
"=",
"new",
"SysProperties",
"(",
")",
";",
"if",
"(",
"arguments",
"!=",
"null",
"&&",
"arguments",
".",
"length",
... | Converts array of JVM arguments to ANT SysProperties object.
@param arguments to be converted.
@return ANT SysProperties object. | [
"Converts",
"array",
"of",
"JVM",
"arguments",
"to",
"ANT",
"SysProperties",
"object",
"."
] | d05ad85663d706e5f0d634f2f8ca6665a6147b3e | https://github.com/jbossws/jbossws-common-tools/blob/d05ad85663d706e5f0d634f2f8ca6665a6147b3e/src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java#L48-L65 | train |
jbossws/jbossws-common-tools | src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java | AntTaskHelper.toVariable | private static Variable toVariable(final String argument)
{
final Variable retVal = new Variable();
final int equalSignIndex = argument.indexOf('=');
if (equalSignIndex == -1)
{
final String key = argument.substring(2);
retVal.setKey(key);
}
else
{
... | java | private static Variable toVariable(final String argument)
{
final Variable retVal = new Variable();
final int equalSignIndex = argument.indexOf('=');
if (equalSignIndex == -1)
{
final String key = argument.substring(2);
retVal.setKey(key);
}
else
{
... | [
"private",
"static",
"Variable",
"toVariable",
"(",
"final",
"String",
"argument",
")",
"{",
"final",
"Variable",
"retVal",
"=",
"new",
"Variable",
"(",
")",
";",
"final",
"int",
"equalSignIndex",
"=",
"argument",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
... | Converts JVM property of format -Dkey=value to ANT Variable object.
@param argument to be converted
@return ANT Variable object | [
"Converts",
"JVM",
"property",
"of",
"format",
"-",
"Dkey",
"=",
"value",
"to",
"ANT",
"Variable",
"object",
"."
] | d05ad85663d706e5f0d634f2f8ca6665a6147b3e | https://github.com/jbossws/jbossws-common-tools/blob/d05ad85663d706e5f0d634f2f8ca6665a6147b3e/src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java#L73-L92 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java | HBeanProperties.getProperties | public static String[][] getProperties(final Bean bean) {
final List<String> propertyNames = bean.getPropertyNames();
final int psize = propertyNames.size();
final String[][] properties = new String[psize][];
for (int i = 0; i < psize; i++) {
final String propertyName = prope... | java | public static String[][] getProperties(final Bean bean) {
final List<String> propertyNames = bean.getPropertyNames();
final int psize = propertyNames.size();
final String[][] properties = new String[psize][];
for (int i = 0; i < psize; i++) {
final String propertyName = prope... | [
"public",
"static",
"String",
"[",
"]",
"[",
"]",
"getProperties",
"(",
"final",
"Bean",
"bean",
")",
"{",
"final",
"List",
"<",
"String",
">",
"propertyNames",
"=",
"bean",
".",
"getPropertyNames",
"(",
")",
";",
"final",
"int",
"psize",
"=",
"propertyN... | In order to reduce the amount of property data stored, we convert the
properties into a String matrix. The first element is the property name
followed by its values.
@param bean Bean to lookup properties from.
@return String matrix | [
"In",
"order",
"to",
"reduce",
"the",
"amount",
"of",
"property",
"data",
"stored",
"we",
"convert",
"the",
"properties",
"into",
"a",
"String",
"matrix",
".",
"The",
"first",
"element",
"is",
"the",
"property",
"name",
"followed",
"by",
"its",
"values",
"... | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java#L168-L183 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java | HBeanProperties.setPropertiesOn | public void setPropertiesOn(final Bean bean) {
String[][] properties = getProperties();
for (int i = 0; i < properties.length; i++) {
if (properties[i].length < 2) {
continue;
}
for (int j = 0; j < properties[i].length - 1; j++) {
bean.... | java | public void setPropertiesOn(final Bean bean) {
String[][] properties = getProperties();
for (int i = 0; i < properties.length; i++) {
if (properties[i].length < 2) {
continue;
}
for (int j = 0; j < properties[i].length - 1; j++) {
bean.... | [
"public",
"void",
"setPropertiesOn",
"(",
"final",
"Bean",
"bean",
")",
"{",
"String",
"[",
"]",
"[",
"]",
"properties",
"=",
"getProperties",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"properties",
".",
"length",
";",
"i",
"+... | Set a string matrix of properties on a particular bean.
@param bean Bean to set properties on.
@param properties in string matrix form. | [
"Set",
"a",
"string",
"matrix",
"of",
"properties",
"on",
"a",
"particular",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java#L211-L221 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java | HBeanProperties.getPropertyName | public static String getPropertyName(KeyValue kv, UniqueIds uids) {
final byte[] qualifier = kv.getQualifier();
final byte[] pid = new byte[] { qualifier[2], qualifier[3] };
final String propertyName = uids.getUsid().getName(pid);
return propertyName;
} | java | public static String getPropertyName(KeyValue kv, UniqueIds uids) {
final byte[] qualifier = kv.getQualifier();
final byte[] pid = new byte[] { qualifier[2], qualifier[3] };
final String propertyName = uids.getUsid().getName(pid);
return propertyName;
} | [
"public",
"static",
"String",
"getPropertyName",
"(",
"KeyValue",
"kv",
",",
"UniqueIds",
"uids",
")",
"{",
"final",
"byte",
"[",
"]",
"qualifier",
"=",
"kv",
".",
"getQualifier",
"(",
")",
";",
"final",
"byte",
"[",
"]",
"pid",
"=",
"new",
"byte",
"["... | Extract the property name from a key value. | [
"Extract",
"the",
"property",
"name",
"from",
"a",
"key",
"value",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java#L226-L231 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java | HBeanProperties.isProperty | public static boolean isProperty(KeyValue kv) {
if (Bytes.equals(kv.getFamily(), PROP_COLUMN_FAMILY)) {
return true;
}
return false;
} | java | public static boolean isProperty(KeyValue kv) {
if (Bytes.equals(kv.getFamily(), PROP_COLUMN_FAMILY)) {
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isProperty",
"(",
"KeyValue",
"kv",
")",
"{",
"if",
"(",
"Bytes",
".",
"equals",
"(",
"kv",
".",
"getFamily",
"(",
")",
",",
"PROP_COLUMN_FAMILY",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | If this key value is of property familiy type. | [
"If",
"this",
"key",
"value",
"is",
"of",
"property",
"familiy",
"type",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanProperties.java#L236-L241 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java | HBeanTable.listEager | public HBeanRowCollector listEager(String schemaName, FetchType... fetchType)
throws HBeanNotFoundException {
Set<HBeanRow> rows = listLazy(schemaName, fetchType);
HBeanRowCollector collector = new HBeanRowCollector(rows);
getEager(rows, collector, FETCH_DEPTH_MAX, fetchType);
... | java | public HBeanRowCollector listEager(String schemaName, FetchType... fetchType)
throws HBeanNotFoundException {
Set<HBeanRow> rows = listLazy(schemaName, fetchType);
HBeanRowCollector collector = new HBeanRowCollector(rows);
getEager(rows, collector, FETCH_DEPTH_MAX, fetchType);
... | [
"public",
"HBeanRowCollector",
"listEager",
"(",
"String",
"schemaName",
",",
"FetchType",
"...",
"fetchType",
")",
"throws",
"HBeanNotFoundException",
"{",
"Set",
"<",
"HBeanRow",
">",
"rows",
"=",
"listLazy",
"(",
"schemaName",
",",
"fetchType",
")",
";",
"HBe... | Fetch list rows for a particular schema and traverse and fetch references eagerly.
@param schemaName schema to fetch
@param fetchType data to fetch
@return collector carring the result from the query | [
"Fetch",
"list",
"rows",
"for",
"a",
"particular",
"schema",
"and",
"traverse",
"and",
"fetch",
"references",
"eagerly",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java#L79-L85 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java | HBeanTable.getEager | public HBeanRowCollector getEager(Set<HBeanRow> rows, FetchType... fetchType)
throws HBeanNotFoundException {
Set<HBeanRow> result;
result = getLazy(rows, fetchType);
HBeanRowCollector collector = new HBeanRowCollector(result);
getEager(result, collector, FETCH_DEPTH_MAX, fet... | java | public HBeanRowCollector getEager(Set<HBeanRow> rows, FetchType... fetchType)
throws HBeanNotFoundException {
Set<HBeanRow> result;
result = getLazy(rows, fetchType);
HBeanRowCollector collector = new HBeanRowCollector(result);
getEager(result, collector, FETCH_DEPTH_MAX, fet... | [
"public",
"HBeanRowCollector",
"getEager",
"(",
"Set",
"<",
"HBeanRow",
">",
"rows",
",",
"FetchType",
"...",
"fetchType",
")",
"throws",
"HBeanNotFoundException",
"{",
"Set",
"<",
"HBeanRow",
">",
"result",
";",
"result",
"=",
"getLazy",
"(",
"rows",
",",
"... | Fetch a set of rows and traverse and fetch references eagerly.
@param rows to fetch
@param fetchType data to fetch
@return collector carring the result from the query | [
"Fetch",
"a",
"set",
"of",
"rows",
"and",
"traverse",
"and",
"fetch",
"references",
"eagerly",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java#L94-L101 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java | HBeanTable.put | public void put(Set<HBeanRow> rows) {
final List<Row> create = new ArrayList<>();
try {
for (HBeanRow row : rows) {
final Put write = new Put(row.getRowKey());
if (row.getPropertiesKeyValue() != null) {
write.add(row.getPropertiesKeyValue()... | java | public void put(Set<HBeanRow> rows) {
final List<Row> create = new ArrayList<>();
try {
for (HBeanRow row : rows) {
final Put write = new Put(row.getRowKey());
if (row.getPropertiesKeyValue() != null) {
write.add(row.getPropertiesKeyValue()... | [
"public",
"void",
"put",
"(",
"Set",
"<",
"HBeanRow",
">",
"rows",
")",
"{",
"final",
"List",
"<",
"Row",
">",
"create",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"for",
"(",
"HBeanRow",
"row",
":",
"rows",
")",
"{",
"final",
"Put... | Put a set of rows.
@param rows to put. | [
"Put",
"a",
"set",
"of",
"rows",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java#L219-L252 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java | HBeanTable.getEager | private void getEager(Set<HBeanRow> rows, HBeanRowCollector collector, int level,
FetchType... fetchType) throws HBeanNotFoundException {
int size = rows.size();
if (size == 0) {
return;
}
if (--level < 0) {
return;
}
Set<HBeanRow> refs... | java | private void getEager(Set<HBeanRow> rows, HBeanRowCollector collector, int level,
FetchType... fetchType) throws HBeanNotFoundException {
int size = rows.size();
if (size == 0) {
return;
}
if (--level < 0) {
return;
}
Set<HBeanRow> refs... | [
"private",
"void",
"getEager",
"(",
"Set",
"<",
"HBeanRow",
">",
"rows",
",",
"HBeanRowCollector",
"collector",
",",
"int",
"level",
",",
"FetchType",
"...",
"fetchType",
")",
"throws",
"HBeanNotFoundException",
"{",
"int",
"size",
"=",
"rows",
".",
"size",
... | Recursive method for traversing and collecting row references. | [
"Recursive",
"method",
"for",
"traversing",
"and",
"collecting",
"row",
"references",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java#L257-L277 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java | HBeanTable.delete | public void delete(Set<HBeanRow> rows) {
final List<Row> delete = new ArrayList<>();
try {
for (HBeanRow row : rows) {
delete.add(new Delete(row.getRowKey()));
}
table.batch(delete);
table.flushCommits();
} catch (Exception e) {
... | java | public void delete(Set<HBeanRow> rows) {
final List<Row> delete = new ArrayList<>();
try {
for (HBeanRow row : rows) {
delete.add(new Delete(row.getRowKey()));
}
table.batch(delete);
table.flushCommits();
} catch (Exception e) {
... | [
"public",
"void",
"delete",
"(",
"Set",
"<",
"HBeanRow",
">",
"rows",
")",
"{",
"final",
"List",
"<",
"Row",
">",
"delete",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"for",
"(",
"HBeanRow",
"row",
":",
"rows",
")",
"{",
"delete",
... | Delete a set of rows.
@param rows to be deleted. | [
"Delete",
"a",
"set",
"of",
"rows",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java#L284-L295 | train |
deephacks/confit | api-provider/src/main/java/org/deephacks/confit/spi/ValidationManager.java | ValidationManager.lookup | public static Optional<ValidationManager> lookup() {
ValidationManager manager = lookup.lookup(ValidationManager.class);
if (manager != null) {
return Optional.of(manager);
} else {
return Optional.absent();
}
} | java | public static Optional<ValidationManager> lookup() {
ValidationManager manager = lookup.lookup(ValidationManager.class);
if (manager != null) {
return Optional.of(manager);
} else {
return Optional.absent();
}
} | [
"public",
"static",
"Optional",
"<",
"ValidationManager",
">",
"lookup",
"(",
")",
"{",
"ValidationManager",
"manager",
"=",
"lookup",
".",
"lookup",
"(",
"ValidationManager",
".",
"class",
")",
";",
"if",
"(",
"manager",
"!=",
"null",
")",
"{",
"return",
... | Lookup the most suitable ValidationManager available.
@return ValidationManager. | [
"Lookup",
"the",
"most",
"suitable",
"ValidationManager",
"available",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-provider/src/main/java/org/deephacks/confit/spi/ValidationManager.java#L21-L28 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.addProperties | public void addProperties(List<JpaProperty> queryProperties) {
for (JpaProperty prop : queryProperties) {
Bean bean = putIfAbsent(prop.getId());
if (!JpaProperty.BEAN_MARKER_PROPERTY_NAME.equals(prop.getPropertyName())) {
bean.addProperty(prop.getPropertyName(), prop.getV... | java | public void addProperties(List<JpaProperty> queryProperties) {
for (JpaProperty prop : queryProperties) {
Bean bean = putIfAbsent(prop.getId());
if (!JpaProperty.BEAN_MARKER_PROPERTY_NAME.equals(prop.getPropertyName())) {
bean.addProperty(prop.getPropertyName(), prop.getV... | [
"public",
"void",
"addProperties",
"(",
"List",
"<",
"JpaProperty",
">",
"queryProperties",
")",
"{",
"for",
"(",
"JpaProperty",
"prop",
":",
"queryProperties",
")",
"{",
"Bean",
"bean",
"=",
"putIfAbsent",
"(",
"prop",
".",
"getId",
"(",
")",
")",
";",
... | Add properties to appropriate bean found from a partial
query of bean properties. | [
"Add",
"properties",
"to",
"appropriate",
"bean",
"found",
"from",
"a",
"partial",
"query",
"of",
"bean",
"properties",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L68-L75 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.addRefs | public void addRefs(Multimap<BeanId, JpaRef> queryRefs) {
refs.putAll(queryRefs);
for (BeanId id : refs.keySet()) {
putIfAbsent(id);
for (JpaRef ref : refs.get(id)) {
putIfAbsent(ref.getTarget());
}
}
} | java | public void addRefs(Multimap<BeanId, JpaRef> queryRefs) {
refs.putAll(queryRefs);
for (BeanId id : refs.keySet()) {
putIfAbsent(id);
for (JpaRef ref : refs.get(id)) {
putIfAbsent(ref.getTarget());
}
}
} | [
"public",
"void",
"addRefs",
"(",
"Multimap",
"<",
"BeanId",
",",
"JpaRef",
">",
"queryRefs",
")",
"{",
"refs",
".",
"putAll",
"(",
"queryRefs",
")",
";",
"for",
"(",
"BeanId",
"id",
":",
"refs",
".",
"keySet",
"(",
")",
")",
"{",
"putIfAbsent",
"(",... | Add references found from a partial query of bean references. | [
"Add",
"references",
"found",
"from",
"a",
"partial",
"query",
"of",
"bean",
"references",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L80-L88 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.getIds | public Set<BeanId> getIds() {
Set<BeanId> ids = new HashSet<>();
ids.addAll(beansQuery);
ids.addAll(beans.keySet());
return ids;
} | java | public Set<BeanId> getIds() {
Set<BeanId> ids = new HashSet<>();
ids.addAll(beansQuery);
ids.addAll(beans.keySet());
return ids;
} | [
"public",
"Set",
"<",
"BeanId",
">",
"getIds",
"(",
")",
"{",
"Set",
"<",
"BeanId",
">",
"ids",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"ids",
".",
"addAll",
"(",
"beansQuery",
")",
";",
"ids",
".",
"addAll",
"(",
"beans",
".",
"keySet",
"(",... | Return list bean ids that the assembler is currently aware of. | [
"Return",
"list",
"bean",
"ids",
"that",
"the",
"assembler",
"is",
"currently",
"aware",
"of",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L102-L107 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.putIfAbsent | private Bean putIfAbsent(BeanId id) {
Bean bean = beans.get(id);
if (bean == null) {
bean = Bean.create(id);
beans.put(id, bean);
}
return bean;
} | java | private Bean putIfAbsent(BeanId id) {
Bean bean = beans.get(id);
if (bean == null) {
bean = Bean.create(id);
beans.put(id, bean);
}
return bean;
} | [
"private",
"Bean",
"putIfAbsent",
"(",
"BeanId",
"id",
")",
"{",
"Bean",
"bean",
"=",
"beans",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"bean",
"==",
"null",
")",
"{",
"bean",
"=",
"Bean",
".",
"create",
"(",
"id",
")",
";",
"beans",
".",
"p... | Add a empty bean based on id if it does not already exist. | [
"Add",
"a",
"empty",
"bean",
"based",
"on",
"id",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L120-L127 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.assembleBeans | public List<Bean> assembleBeans() {
connectReferences();
if (beansQuery.size() == 0) {
// if no specific beans where requested (such as query for a
// specific schema) return what is available.
return new ArrayList<>(beans.values());
}
List<Bean> init... | java | public List<Bean> assembleBeans() {
connectReferences();
if (beansQuery.size() == 0) {
// if no specific beans where requested (such as query for a
// specific schema) return what is available.
return new ArrayList<>(beans.values());
}
List<Bean> init... | [
"public",
"List",
"<",
"Bean",
">",
"assembleBeans",
"(",
")",
"{",
"connectReferences",
"(",
")",
";",
"if",
"(",
"beansQuery",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"// if no specific beans where requested (such as query for a",
"// specific schema) return w... | Assemble beans and initalize their properties and references
from what have been provided.
@return the beans that were provided in the inital query. | [
"Assemble",
"beans",
"and",
"initalize",
"their",
"properties",
"and",
"references",
"from",
"what",
"have",
"been",
"provided",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L135-L151 | train |
deephacks/confit | provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java | JpaBeanQueryAssembler.connectReferences | private void connectReferences() {
// ready to associate initalized beans with references
for (Bean bean : beans.values()) {
for (JpaRef ref : refs.get(bean.getId())) {
BeanId target = ref.getTarget();
Bean targetBean = beans.get(target);
targe... | java | private void connectReferences() {
// ready to associate initalized beans with references
for (Bean bean : beans.values()) {
for (JpaRef ref : refs.get(bean.getId())) {
BeanId target = ref.getTarget();
Bean targetBean = beans.get(target);
targe... | [
"private",
"void",
"connectReferences",
"(",
")",
"{",
"// ready to associate initalized beans with references",
"for",
"(",
"Bean",
"bean",
":",
"beans",
".",
"values",
"(",
")",
")",
"{",
"for",
"(",
"JpaRef",
"ref",
":",
"refs",
".",
"get",
"(",
"bean",
"... | Assemble beans and initalize references from what have been provided. | [
"Assemble",
"beans",
"and",
"initalize",
"references",
"from",
"what",
"have",
"been",
"provided",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaBeanQueryAssembler.java#L156-L166 | train |
deephacks/confit | provider-cached/src/main/java/org/deephacks/confit/internal/cached/CachedCacheManager.java | CachedCacheManager.flattenReferences | private Set<Bean> flattenReferences(Bean bean) {
Set<Bean> beans = new HashSet<>();
for (String referenceName : bean.getReferenceNames()) {
List<BeanId> ids = bean.getReference(referenceName);
for (BeanId id : ids) {
if (id.getBean() == null) {
... | java | private Set<Bean> flattenReferences(Bean bean) {
Set<Bean> beans = new HashSet<>();
for (String referenceName : bean.getReferenceNames()) {
List<BeanId> ids = bean.getReference(referenceName);
for (BeanId id : ids) {
if (id.getBean() == null) {
... | [
"private",
"Set",
"<",
"Bean",
">",
"flattenReferences",
"(",
"Bean",
"bean",
")",
"{",
"Set",
"<",
"Bean",
">",
"beans",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"referenceName",
":",
"bean",
".",
"getReferenceNames",
"(",
")"... | Bean may, but not necessarily, have deep hierarchies of references
to other beans. Since a cache store beans per schema we must
dig out this hierarchy and flatten it out, | [
"Bean",
"may",
"but",
"not",
"necessarily",
"have",
"deep",
"hierarchies",
"of",
"references",
"to",
"other",
"beans",
".",
"Since",
"a",
"cache",
"store",
"beans",
"per",
"schema",
"we",
"must",
"dig",
"out",
"this",
"hierarchy",
"and",
"flatten",
"it",
"... | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-cached/src/main/java/org/deephacks/confit/internal/cached/CachedCacheManager.java#L142-L155 | train |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBaseBeanManager.java | HBaseBeanManager.createUids | public static UniqueIds createUids(Configuration conf) {
UniqueId usid = new UniqueId(SID_TABLE, SID_WIDTH, conf, true);
UniqueId uiid = new UniqueId(IID_TABLE, IID_WIDTH, conf, true);
UniqueId upid = new UniqueId(PID_TABLE, PID_WIDTH, conf, true);
return new UniqueIds(uiid, usid, upid);... | java | public static UniqueIds createUids(Configuration conf) {
UniqueId usid = new UniqueId(SID_TABLE, SID_WIDTH, conf, true);
UniqueId uiid = new UniqueId(IID_TABLE, IID_WIDTH, conf, true);
UniqueId upid = new UniqueId(PID_TABLE, PID_WIDTH, conf, true);
return new UniqueIds(uiid, usid, upid);... | [
"public",
"static",
"UniqueIds",
"createUids",
"(",
"Configuration",
"conf",
")",
"{",
"UniqueId",
"usid",
"=",
"new",
"UniqueId",
"(",
"SID_TABLE",
",",
"SID_WIDTH",
",",
"conf",
",",
"true",
")",
";",
"UniqueId",
"uiid",
"=",
"new",
"UniqueId",
"(",
"IID... | Create the unique lookup tables.
@param conf HBase configuration.
@return a holder for sid and iid lookup. | [
"Create",
"the",
"unique",
"lookup",
"tables",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBaseBeanManager.java#L91-L96 | train |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/digest/MD5DigestFileEntry.java | MD5DigestFileEntry.getContent | private byte[] getContent()
throws IOException
{
InputStream is = null;
try
{
MessageDigest digest = MessageDigest.getInstance( "MD5" );
digest.reset();
byte[] buffer = new byte[8192];
int read;
try
{
... | java | private byte[] getContent()
throws IOException
{
InputStream is = null;
try
{
MessageDigest digest = MessageDigest.getInstance( "MD5" );
digest.reset();
byte[] buffer = new byte[8192];
int read;
try
{
... | [
"private",
"byte",
"[",
"]",
"getContent",
"(",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"MessageDigest",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
")",
";",
"digest",
".",
"reset",
"("... | Generates the digest.
@return the digest.
@throws IOException if the backing entry could not be read.
@since 1.0 | [
"Generates",
"the",
"digest",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/digest/MD5DigestFileEntry.java#L103-L141 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java | AbstractConfigObject.peekPath | AbstractConfigValue peekPath(Path path) {
try {
return peekPath(this, path, null);
} catch (NotPossibleToResolve e) {
throw new BugOrBroken(
"NotPossibleToResolve happened though we had no ResolveContext in peekPath");
}
} | java | AbstractConfigValue peekPath(Path path) {
try {
return peekPath(this, path, null);
} catch (NotPossibleToResolve e) {
throw new BugOrBroken(
"NotPossibleToResolve happened though we had no ResolveContext in peekPath");
}
} | [
"AbstractConfigValue",
"peekPath",
"(",
"Path",
"path",
")",
"{",
"try",
"{",
"return",
"peekPath",
"(",
"this",
",",
"path",
",",
"null",
")",
";",
"}",
"catch",
"(",
"NotPossibleToResolve",
"e",
")",
"{",
"throw",
"new",
"BugOrBroken",
"(",
"\"NotPossibl... | Looks up the path. Doesn't do any resolution, will throw if any is
needed. | [
"Looks",
"up",
"the",
"path",
".",
"Doesn",
"t",
"do",
"any",
"resolution",
"will",
"throw",
"if",
"any",
"is",
"needed",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java#L103-L110 | train |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java | AbstractConfigObject.peekPath | private static AbstractConfigValue peekPath(AbstractConfigObject self, Path path,
ResolveContext context) throws NotPossibleToResolve {
try {
if (context != null) {
// walk down through the path resolving only things along that
// path, and then recursivel... | java | private static AbstractConfigValue peekPath(AbstractConfigObject self, Path path,
ResolveContext context) throws NotPossibleToResolve {
try {
if (context != null) {
// walk down through the path resolving only things along that
// path, and then recursivel... | [
"private",
"static",
"AbstractConfigValue",
"peekPath",
"(",
"AbstractConfigObject",
"self",
",",
"Path",
"path",
",",
"ResolveContext",
"context",
")",
"throws",
"NotPossibleToResolve",
"{",
"try",
"{",
"if",
"(",
"context",
"!=",
"null",
")",
"{",
"// walk down ... | the child itself if needed. | [
"the",
"child",
"itself",
"if",
"needed",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java#L115-L148 | train |
mojohaus/mrm | mrm-api/src/main/java/org/codehaus/mojo/mrm/api/maven/Artifact.java | Artifact.getName | public String getName()
{
if ( name == null )
{
name = MessageFormat.format( "{0}-{1}{2}.{3}", new Object[]{ artifactId, getTimestampVersion(),
( classifier == null ? "" : "-" + classifier ), type } );
}
return name;
} | java | public String getName()
{
if ( name == null )
{
name = MessageFormat.format( "{0}-{1}{2}.{3}", new Object[]{ artifactId, getTimestampVersion(),
( classifier == null ? "" : "-" + classifier ), type } );
}
return name;
} | [
"public",
"String",
"getName",
"(",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"name",
"=",
"MessageFormat",
".",
"format",
"(",
"\"{0}-{1}{2}.{3}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"artifactId",
",",
"getTimestampVersion",
"(",
")",
",",... | Returns the name of the artifact.
@return the name of the artifact.
@since 1.0 | [
"Returns",
"the",
"name",
"of",
"the",
"artifact",
"."
] | ecbe54a1866f210c10bf2e9274b63d4804d6a151 | https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-api/src/main/java/org/codehaus/mojo/mrm/api/maven/Artifact.java#L211-L219 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.create | public static Bean create(final BeanId id) {
Preconditions.checkNotNull(id);
Bean bean = new Bean(id);
bean.set(id.getSchema());
return bean;
} | java | public static Bean create(final BeanId id) {
Preconditions.checkNotNull(id);
Bean bean = new Bean(id);
bean.set(id.getSchema());
return bean;
} | [
"public",
"static",
"Bean",
"create",
"(",
"final",
"BeanId",
"id",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"id",
")",
";",
"Bean",
"bean",
"=",
"new",
"Bean",
"(",
"id",
")",
";",
"bean",
".",
"set",
"(",
"id",
".",
"getSchema",
"(",
... | Create a admin bean instance.
@param id unique identification of the bean instance.
@return AdminBean | [
"Create",
"a",
"admin",
"bean",
"instance",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L81-L86 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.getPropertyNames | public List<String> getPropertyNames() {
ArrayList<String> names = new ArrayList<>(properties.keySet());
Collections.sort(names);
return names;
} | java | public List<String> getPropertyNames() {
ArrayList<String> names = new ArrayList<>(properties.keySet());
Collections.sort(names);
return names;
} | [
"public",
"List",
"<",
"String",
">",
"getPropertyNames",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<>",
"(",
"properties",
".",
"keySet",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"names",
")",
";",
... | Return the list of property names which have values. Properties
with default values are not returned.
@return list of property names. | [
"Return",
"the",
"list",
"of",
"property",
"names",
"which",
"have",
"values",
".",
"Properties",
"with",
"default",
"values",
"are",
"not",
"returned",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L121-L125 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.getReferenceNames | public List<String> getReferenceNames() {
ArrayList<String> names = new ArrayList<>(references.keySet());
Collections.sort(names);
return names;
} | java | public List<String> getReferenceNames() {
ArrayList<String> names = new ArrayList<>(references.keySet());
Collections.sort(names);
return names;
} | [
"public",
"List",
"<",
"String",
">",
"getReferenceNames",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<>",
"(",
"references",
".",
"keySet",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"names",
")",
";",... | Return the list of property names which are references.
@return list of property names. | [
"Return",
"the",
"list",
"of",
"property",
"names",
"which",
"are",
"references",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L132-L136 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.addProperty | public void addProperty(final String propertyName, final Collection<String> values) {
Preconditions.checkNotNull(values);
Preconditions.checkNotNull(propertyName);
List<String> list = properties.get(propertyName);
if (list == null) {
properties.put(propertyName, new ArrayList... | java | public void addProperty(final String propertyName, final Collection<String> values) {
Preconditions.checkNotNull(values);
Preconditions.checkNotNull(propertyName);
List<String> list = properties.get(propertyName);
if (list == null) {
properties.put(propertyName, new ArrayList... | [
"public",
"void",
"addProperty",
"(",
"final",
"String",
"propertyName",
",",
"final",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"values",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",... | Add a list of value to a property on this bean.
@param propertyName name of the property as defined by the bean's schema.
@param values final String representations of the parameterized type of the collection
that conforms to its type as defined by the bean's schema. | [
"Add",
"a",
"list",
"of",
"value",
"to",
"a",
"property",
"on",
"this",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L145-L154 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.addProperty | public void addProperty(final String propertyName, final String value) {
Preconditions.checkNotNull(propertyName);
Preconditions.checkNotNull(value);
List<String> values = properties.get(propertyName);
if (values == null) {
values = new ArrayList<>();
values.add(v... | java | public void addProperty(final String propertyName, final String value) {
Preconditions.checkNotNull(propertyName);
Preconditions.checkNotNull(value);
List<String> values = properties.get(propertyName);
if (values == null) {
values = new ArrayList<>();
values.add(v... | [
"public",
"void",
"addProperty",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"value",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"value",
")",
";",
"List",
"<",
... | Add a value to a property on this bean.
@param propertyName name of the property as defined by the bean's schema.
@param value final String representations of the property that conforms to
its type as defined by the bean's schema. | [
"Add",
"a",
"value",
"to",
"a",
"property",
"on",
"this",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L163-L174 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.setProperty | public void setProperty(final String propertyName, final String value) {
Preconditions.checkNotNull(propertyName);
if (value == null) {
properties.put(propertyName, null);
return;
}
List<String> values = new ArrayList<>();
values.add(value);
proper... | java | public void setProperty(final String propertyName, final String value) {
Preconditions.checkNotNull(propertyName);
if (value == null) {
properties.put(propertyName, null);
return;
}
List<String> values = new ArrayList<>();
values.add(value);
proper... | [
"public",
"void",
"setProperty",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"value",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"properties",
".",
"put",
"... | Overwrite the current values with the provided value.
@param propertyName name of the property as defined by the bean's schema.
@param value final String representations of the property that conforms to
its type as defined by the bean's schema. | [
"Overwrite",
"the",
"current",
"values",
"with",
"the",
"provided",
"value",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L183-L192 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.clear | public void clear(final String propertyName) {
Preconditions.checkNotNull(propertyName);
if (properties.containsKey(propertyName)) {
properties.put(propertyName, null);
} else if (references.containsKey(propertyName)) {
references.put(propertyName, null);
}
} | java | public void clear(final String propertyName) {
Preconditions.checkNotNull(propertyName);
if (properties.containsKey(propertyName)) {
properties.put(propertyName, null);
} else if (references.containsKey(propertyName)) {
references.put(propertyName, null);
}
} | [
"public",
"void",
"clear",
"(",
"final",
"String",
"propertyName",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"properties",
".",
"put",
"(",
... | Clear the values of a property or reference, setting it to null.
This operation can be useful when removing properties using "merge"
operation.
@param propertyName of the property as defined by the bean's schema. | [
"Clear",
"the",
"values",
"of",
"a",
"property",
"or",
"reference",
"setting",
"it",
"to",
"null",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L218-L225 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.remove | public void remove(final String propertyName) {
Preconditions.checkNotNull(propertyName);
if (properties.containsKey(propertyName)) {
properties.remove(propertyName);
} else if (references.containsKey(propertyName)) {
references.remove(propertyName);
}
} | java | public void remove(final String propertyName) {
Preconditions.checkNotNull(propertyName);
if (properties.containsKey(propertyName)) {
properties.remove(propertyName);
} else if (references.containsKey(propertyName)) {
references.remove(propertyName);
}
} | [
"public",
"void",
"remove",
"(",
"final",
"String",
"propertyName",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"properties",
".",
"remove",
"... | Remove a property or reference as a property from this bean.
This operation can be useful when removing properties using "set"
operation.
@param propertyName name of the property as defined by the bean's schema. | [
"Remove",
"a",
"property",
"or",
"reference",
"as",
"a",
"property",
"from",
"this",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L235-L242 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.getValues | public List<String> getValues(final String propertyName) {
Preconditions.checkNotNull(propertyName);
List<String> values = properties.get(propertyName);
if (values == null) {
return null;
}
// creates a shallow defensive copy
return new ArrayList<>(values);
... | java | public List<String> getValues(final String propertyName) {
Preconditions.checkNotNull(propertyName);
List<String> values = properties.get(propertyName);
if (values == null) {
return null;
}
// creates a shallow defensive copy
return new ArrayList<>(values);
... | [
"public",
"List",
"<",
"String",
">",
"getValues",
"(",
"final",
"String",
"propertyName",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"List",
"<",
"String",
">",
"values",
"=",
"properties",
".",
"get",
"(",
"propertyName"... | Get the values of a property on a bean.
@param propertyName of the property as defined by the bean's schema.
@return final String representations of the property that conforms to
its type as defined by the bean's schema. | [
"Get",
"the",
"values",
"of",
"a",
"property",
"on",
"a",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L251-L259 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.getSingleValue | public String getSingleValue(final String propertyName) {
Preconditions.checkNotNull(propertyName);
List<String> values = getValues(propertyName);
if (values == null || values.size() < 1) {
return null;
}
return values.get(0);
} | java | public String getSingleValue(final String propertyName) {
Preconditions.checkNotNull(propertyName);
List<String> values = getValues(propertyName);
if (values == null || values.size() < 1) {
return null;
}
return values.get(0);
} | [
"public",
"String",
"getSingleValue",
"(",
"final",
"String",
"propertyName",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"List",
"<",
"String",
">",
"values",
"=",
"getValues",
"(",
"propertyName",
")",
";",
"if",
"(",
"va... | A helper method for getting the value of single valued properties. Returns
null if the property does not exist.
@param propertyName name of the property as defined by the bean's schema.
@return final String representations of the property that conforms to
its type as defined by the bean's schema. | [
"A",
"helper",
"method",
"for",
"getting",
"the",
"value",
"of",
"single",
"valued",
"properties",
".",
"Returns",
"null",
"if",
"the",
"property",
"does",
"not",
"exist",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L269-L276 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.addReference | public void addReference(final String propertyName, final Collection<BeanId> refs) {
Preconditions.checkNotNull(refs);
Preconditions.checkNotNull(propertyName);
checkCircularReference(refs.toArray(new BeanId[refs.size()]));
List<BeanId> list = references.get(propertyName);
if (li... | java | public void addReference(final String propertyName, final Collection<BeanId> refs) {
Preconditions.checkNotNull(refs);
Preconditions.checkNotNull(propertyName);
checkCircularReference(refs.toArray(new BeanId[refs.size()]));
List<BeanId> list = references.get(propertyName);
if (li... | [
"public",
"void",
"addReference",
"(",
"final",
"String",
"propertyName",
",",
"final",
"Collection",
"<",
"BeanId",
">",
"refs",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"refs",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
... | Add a list of references to a property on this bean.
A reference identify other beans based on schema and instance id.
@param propertyName name of the property as defined by the bean's schema.
@param refs the reference as defined by the bean's schema. | [
"Add",
"a",
"list",
"of",
"references",
"to",
"a",
"property",
"on",
"this",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L286-L298 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.checkCircularReference | private void checkCircularReference(final BeanId... references) {
for (BeanId beanId : references) {
if (getId().equals(beanId)) {
throw CFG310_CIRCULAR_REF(getId(), getId());
}
}
} | java | private void checkCircularReference(final BeanId... references) {
for (BeanId beanId : references) {
if (getId().equals(beanId)) {
throw CFG310_CIRCULAR_REF(getId(), getId());
}
}
} | [
"private",
"void",
"checkCircularReference",
"(",
"final",
"BeanId",
"...",
"references",
")",
"{",
"for",
"(",
"BeanId",
"beanId",
":",
"references",
")",
"{",
"if",
"(",
"getId",
"(",
")",
".",
"equals",
"(",
"beanId",
")",
")",
"{",
"throw",
"CFG310_C... | Check that references does not point to self.
@param references from | [
"Check",
"that",
"references",
"does",
"not",
"point",
"to",
"self",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L304-L310 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.addReference | public void addReference(final String propertyName, final BeanId ref) {
Preconditions.checkNotNull(ref);
Preconditions.checkNotNull(propertyName);
checkCircularReference(ref);
List<BeanId> list = references.get(propertyName);
if (list == null) {
list = new ArrayList<>... | java | public void addReference(final String propertyName, final BeanId ref) {
Preconditions.checkNotNull(ref);
Preconditions.checkNotNull(propertyName);
checkCircularReference(ref);
List<BeanId> list = references.get(propertyName);
if (list == null) {
list = new ArrayList<>... | [
"public",
"void",
"addReference",
"(",
"final",
"String",
"propertyName",
",",
"final",
"BeanId",
"ref",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"ref",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"checkCircularRefe... | Add a reference to a property on this bean.
A reference identify other beans based on schema and instance id.
@param propertyName name of the property as defined by the bean's schema.
@param ref the reference as defined by the bean's schema. | [
"Add",
"a",
"reference",
"to",
"a",
"property",
"on",
"this",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L321-L333 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.getReference | public List<BeanId> getReference(final String propertyName) {
List<BeanId> values = references.get(propertyName);
if (values == null) {
return null;
}
return values;
} | java | public List<BeanId> getReference(final String propertyName) {
List<BeanId> values = references.get(propertyName);
if (values == null) {
return null;
}
return values;
} | [
"public",
"List",
"<",
"BeanId",
">",
"getReference",
"(",
"final",
"String",
"propertyName",
")",
"{",
"List",
"<",
"BeanId",
">",
"values",
"=",
"references",
".",
"get",
"(",
"propertyName",
")",
";",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"re... | Get the references of a property on a bean.
@param propertyName name of the property as defined by the bean's schema.
@return References that identify other beans. | [
"Get",
"the",
"references",
"of",
"a",
"property",
"on",
"a",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L341-L347 | train |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.getReferences | public List<BeanId> getReferences() {
if (references == null) {
return new ArrayList<>();
}
ArrayList<BeanId> result = new ArrayList<>();
for (List<BeanId> b : references.values()) {
if (b != null) {
result.addAll(b);
}
}
... | java | public List<BeanId> getReferences() {
if (references == null) {
return new ArrayList<>();
}
ArrayList<BeanId> result = new ArrayList<>();
for (List<BeanId> b : references.values()) {
if (b != null) {
result.addAll(b);
}
}
... | [
"public",
"List",
"<",
"BeanId",
">",
"getReferences",
"(",
")",
"{",
"if",
"(",
"references",
"==",
"null",
")",
"{",
"return",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"ArrayList",
"<",
"BeanId",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"... | Get all references for all properties of this bean.
@return References that identify other beans. | [
"Get",
"all",
"references",
"for",
"all",
"properties",
"of",
"this",
"bean",
"."
] | 4e6d4ee5fed32cbc5104433e61de1bcf1b360832 | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L354-L366 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.