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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.convertToString | public static String convertToString(Collection<? extends Object> parameters) {
if (parameters == null || parameters.isEmpty())
return "";
StringBuilder result = new StringBuilder();
for (Object param : parameters) {
if (param instanceof String)
pa... | java | public static String convertToString(Collection<? extends Object> parameters) {
if (parameters == null || parameters.isEmpty())
return "";
StringBuilder result = new StringBuilder();
for (Object param : parameters) {
if (param instanceof String)
pa... | [
"public",
"static",
"String",
"convertToString",
"(",
"Collection",
"<",
"?",
"extends",
"Object",
">",
"parameters",
")",
"{",
"if",
"(",
"parameters",
"==",
"null",
"||",
"parameters",
".",
"isEmpty",
"(",
")",
")",
"return",
"\"\"",
";",
"StringBuilder",
... | Converts a collection with IN parameters to a plain string representation
@param parameters
collection with IN parameters
@return plain string representation | [
"Converts",
"a",
"collection",
"with",
"IN",
"parameters",
"to",
"a",
"plain",
"string",
"representation"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L56-L72 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.listFields | public static List<Field> listFields(Class<?> clazz) {
assert clazz != null;
Class<?> entityClass = clazz;
List<Field> list = new ArrayList<Field>();
while (!Object.class.equals(entityClass) && entityClass != null) {
list.addAll(Arrays.asList(entityClass.getDeclaredFields()... | java | public static List<Field> listFields(Class<?> clazz) {
assert clazz != null;
Class<?> entityClass = clazz;
List<Field> list = new ArrayList<Field>();
while (!Object.class.equals(entityClass) && entityClass != null) {
list.addAll(Arrays.asList(entityClass.getDeclaredFields()... | [
"public",
"static",
"List",
"<",
"Field",
">",
"listFields",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"assert",
"clazz",
"!=",
"null",
";",
"Class",
"<",
"?",
">",
"entityClass",
"=",
"clazz",
";",
"List",
"<",
"Field",
">",
"list",
"=",
"ne... | lists all fields of a given class
@param clazz type
@return | [
"lists",
"all",
"fields",
"of",
"a",
"given",
"class"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L96-L105 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.findField | public static Field findField(Class<?> clazz, String name) {
Class<?> entityClass = clazz;
while (!Object.class.equals(entityClass) && entityClass != null) {
Field[] fields = entityClass.getDeclaredFields();
for (Field field : fields) {
if (name.equals(field.... | java | public static Field findField(Class<?> clazz, String name) {
Class<?> entityClass = clazz;
while (!Object.class.equals(entityClass) && entityClass != null) {
Field[] fields = entityClass.getDeclaredFields();
for (Field field : fields) {
if (name.equals(field.... | [
"public",
"static",
"Field",
"findField",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"Class",
"<",
"?",
">",
"entityClass",
"=",
"clazz",
";",
"while",
"(",
"!",
"Object",
".",
"class",
".",
"equals",
"(",
"entityClass",
"... | tries to find a field by a field name
@param clazz type
@param name name of the field
@return | [
"tries",
"to",
"find",
"a",
"field",
"by",
"a",
"field",
"name"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L114-L126 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.findProperty | public static Method findProperty(Class<?> clazz, String name) {
assert clazz != null;
assert name != null;
Class<?> entityClass = clazz;
while (entityClass != null) {
Method[] methods = (entityClass.isInterface() ? entityClass.getMethods() : entityClass.getDeclaredMethods());... | java | public static Method findProperty(Class<?> clazz, String name) {
assert clazz != null;
assert name != null;
Class<?> entityClass = clazz;
while (entityClass != null) {
Method[] methods = (entityClass.isInterface() ? entityClass.getMethods() : entityClass.getDeclaredMethods());... | [
"public",
"static",
"Method",
"findProperty",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"assert",
"clazz",
"!=",
"null",
";",
"assert",
"name",
"!=",
"null",
";",
"Class",
"<",
"?",
">",
"entityClass",
"=",
"clazz",
";",
... | tries to find a property method by name
@param clazz type
@param name name of the property
@return | [
"tries",
"to",
"find",
"a",
"property",
"method",
"by",
"name"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L135-L150 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.getValue | public static Object getValue(Object instance, String name) {
assert instance != null;
assert name != null;
try {
Class<?> clazz = instance.getClass();
Object value = null;
Method property = findProperty(clazz, name);
if (property != null) {... | java | public static Object getValue(Object instance, String name) {
assert instance != null;
assert name != null;
try {
Class<?> clazz = instance.getClass();
Object value = null;
Method property = findProperty(clazz, name);
if (property != null) {... | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"instance",
",",
"String",
"name",
")",
"{",
"assert",
"instance",
"!=",
"null",
";",
"assert",
"name",
"!=",
"null",
";",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"instance",
".",
"getC... | tries to get the value from a field or a getter property for a given object instance
@param instance the object instance
@param name name of the property or field
@return
@throws IllegalArgumentException
@throws IllegalAccessException
@throws InvocationTargetException | [
"tries",
"to",
"get",
"the",
"value",
"from",
"a",
"field",
"or",
"a",
"getter",
"property",
"for",
"a",
"given",
"object",
"instance"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L162-L185 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.findNamedQuery | public static NamedQuery findNamedQuery(Class<?> type, String name)
{
NamedQuery annotatedNamedQuery = (NamedQuery) type.getAnnotation(NamedQuery.class);
if (annotatedNamedQuery != null) {
return annotatedNamedQuery;
}
NamedQueries annotatedNamedQueries = (NamedQu... | java | public static NamedQuery findNamedQuery(Class<?> type, String name)
{
NamedQuery annotatedNamedQuery = (NamedQuery) type.getAnnotation(NamedQuery.class);
if (annotatedNamedQuery != null) {
return annotatedNamedQuery;
}
NamedQueries annotatedNamedQueries = (NamedQu... | [
"public",
"static",
"NamedQuery",
"findNamedQuery",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"{",
"NamedQuery",
"annotatedNamedQuery",
"=",
"(",
"NamedQuery",
")",
"type",
".",
"getAnnotation",
"(",
"NamedQuery",
".",
"class",
")",
";... | get a named query from an entity
@param type
@param name
@return | [
"get",
"a",
"named",
"query",
"from",
"an",
"entity"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L228-L249 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.createResultCountQuery | public static String createResultCountQuery(String query) {
String resultCountQueryString = null;
int select = query.toLowerCase().indexOf("select");
int from = query.toLowerCase().indexOf("from");
if (select == -1 || from == -1) {
return null;
}
re... | java | public static String createResultCountQuery(String query) {
String resultCountQueryString = null;
int select = query.toLowerCase().indexOf("select");
int from = query.toLowerCase().indexOf("from");
if (select == -1 || from == -1) {
return null;
}
re... | [
"public",
"static",
"String",
"createResultCountQuery",
"(",
"String",
"query",
")",
"{",
"String",
"resultCountQueryString",
"=",
"null",
";",
"int",
"select",
"=",
"query",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"\"select\"",
")",
";",
"int",
"... | Build a query based on the original query to count results
@param query
@return | [
"Build",
"a",
"query",
"based",
"on",
"the",
"original",
"query",
"to",
"count",
"results"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L257-L276 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.toSeparatedString | public static String toSeparatedString(List<?> values, String separator) {
return toSeparatedString(values, separator, null);
} | java | public static String toSeparatedString(List<?> values, String separator) {
return toSeparatedString(values, separator, null);
} | [
"public",
"static",
"String",
"toSeparatedString",
"(",
"List",
"<",
"?",
">",
"values",
",",
"String",
"separator",
")",
"{",
"return",
"toSeparatedString",
"(",
"values",
",",
"separator",
",",
"null",
")",
";",
"}"
] | build a single String from a List of objects with a given separator
@param values
@param separator
@return | [
"build",
"a",
"single",
"String",
"from",
"a",
"List",
"of",
"objects",
"with",
"a",
"given",
"separator"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L285-L287 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.toSeparatedString | public static String toSeparatedString(List<?> values, String separator, String prefix) {
StringBuilder result = new StringBuilder();
for (Object each : values) {
if (each == null) {
continue;
}
if (result.length() > 0) {
result.... | java | public static String toSeparatedString(List<?> values, String separator, String prefix) {
StringBuilder result = new StringBuilder();
for (Object each : values) {
if (each == null) {
continue;
}
if (result.length() > 0) {
result.... | [
"public",
"static",
"String",
"toSeparatedString",
"(",
"List",
"<",
"?",
">",
"values",
",",
"String",
"separator",
",",
"String",
"prefix",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Object",
"each",
":"... | build a single String from a List of objects with a given separator and prefix
@param values
@param separator
@param prefix
@return | [
"build",
"a",
"single",
"String",
"from",
"a",
"List",
"of",
"objects",
"with",
"a",
"given",
"separator",
"and",
"prefix"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L297-L313 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/PublishAdvice.java | PublishAdvice.isJoda | private boolean isJoda(Class<?> clazz) {
for (Constructor<?> each : clazz.getConstructors()) {
Class<?>[] parameterTypes = each.getParameterTypes();
if (parameterTypes.length > 0) {
if (parameterTypes[0].getName().startsWith("org.joda.time.")) {
return... | java | private boolean isJoda(Class<?> clazz) {
for (Constructor<?> each : clazz.getConstructors()) {
Class<?>[] parameterTypes = each.getParameterTypes();
if (parameterTypes.length > 0) {
if (parameterTypes[0].getName().startsWith("org.joda.time.")) {
return... | [
"private",
"boolean",
"isJoda",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"for",
"(",
"Constructor",
"<",
"?",
">",
"each",
":",
"clazz",
".",
"getConstructors",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
"=",
"ea... | Check if joda date time library is used, without introducing runtime
dependency. | [
"Check",
"if",
"joda",
"date",
"time",
"library",
"is",
"used",
"without",
"introducing",
"runtime",
"dependency",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/annotation/PublishAdvice.java#L145-L155 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ErrorHandlingAdvice.java | ErrorHandlingAdvice.afterThrowing | public void afterThrowing(Method m, Object[] args, Object target, ConcurrencyFailureException e)
throws OptimisticLockingException {
handleOptimisticLockingException(target, e);
} | java | public void afterThrowing(Method m, Object[] args, Object target, ConcurrencyFailureException e)
throws OptimisticLockingException {
handleOptimisticLockingException(target, e);
} | [
"public",
"void",
"afterThrowing",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
",",
"Object",
"target",
",",
"ConcurrencyFailureException",
"e",
")",
"throws",
"OptimisticLockingException",
"{",
"handleOptimisticLockingException",
"(",
"target",
",",
"e",
... | Spring exception for Optimistic Locking. | [
"Spring",
"exception",
"for",
"Optimistic",
"Locking",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ErrorHandlingAdvice.java#L111-L114 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/check/AggregateConstraints.java | AggregateConstraints.checkAggregateReferences | public static boolean checkAggregateReferences(Application app) {
Map<DomainObject, Set<DomainObject>> aggregateGroups = getAggregateGroups(app);
for (Set<DomainObject> group1 : aggregateGroups.values()) {
for (Set<DomainObject> group2 : aggregateGroups.values()) {
if (group1 == group2) {
continue;
... | java | public static boolean checkAggregateReferences(Application app) {
Map<DomainObject, Set<DomainObject>> aggregateGroups = getAggregateGroups(app);
for (Set<DomainObject> group1 : aggregateGroups.values()) {
for (Set<DomainObject> group2 : aggregateGroups.values()) {
if (group1 == group2) {
continue;
... | [
"public",
"static",
"boolean",
"checkAggregateReferences",
"(",
"Application",
"app",
")",
"{",
"Map",
"<",
"DomainObject",
",",
"Set",
"<",
"DomainObject",
">",
">",
"aggregateGroups",
"=",
"getAggregateGroups",
"(",
"app",
")",
";",
"for",
"(",
"Set",
"<",
... | According to DDD the aggregate root is the only member of the aggregate
that objects outside the aggregate boundary may hold references to. | [
"According",
"to",
"DDD",
"the",
"aggregate",
"root",
"is",
"the",
"only",
"member",
"of",
"the",
"aggregate",
"that",
"objects",
"outside",
"the",
"aggregate",
"boundary",
"may",
"hold",
"references",
"to",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/check/AggregateConstraints.java#L50-L74 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/LocalDateEditor.java | LocalDateEditor.setAsText | public void setAsText(String text) throws IllegalArgumentException {
if (this.allowEmpty && !StringUtils.hasText(text)) {
// Treat empty String as null value.
setValue(null);
} else {
setValue(new LocalDate(this.formatter.parseDateTime(text)));
}
} | java | public void setAsText(String text) throws IllegalArgumentException {
if (this.allowEmpty && !StringUtils.hasText(text)) {
// Treat empty String as null value.
setValue(null);
} else {
setValue(new LocalDate(this.formatter.parseDateTime(text)));
}
} | [
"public",
"void",
"setAsText",
"(",
"String",
"text",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"this",
".",
"allowEmpty",
"&&",
"!",
"StringUtils",
".",
"hasText",
"(",
"text",
")",
")",
"{",
"// Treat empty String as null value.\r",
"setValue",
... | Parse the value from the given text, using the specified format. | [
"Parse",
"the",
"value",
"from",
"the",
"given",
"text",
"using",
"the",
"specified",
"format",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/LocalDateEditor.java#L63-L70 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/LocalDateEditor.java | LocalDateEditor.getAsText | public String getAsText() {
LocalDate value = (LocalDate) getValue();
return (value != null ? value.toString(this.formatter) : "");
} | java | public String getAsText() {
LocalDate value = (LocalDate) getValue();
return (value != null ? value.toString(this.formatter) : "");
} | [
"public",
"String",
"getAsText",
"(",
")",
"{",
"LocalDate",
"value",
"=",
"(",
"LocalDate",
")",
"getValue",
"(",
")",
";",
"return",
"(",
"value",
"!=",
"null",
"?",
"value",
".",
"toString",
"(",
"this",
".",
"formatter",
")",
":",
"\"\"",
")",
";... | Format the LocalDate as String, using the specified format. | [
"Format",
"the",
"LocalDate",
"as",
"String",
"using",
"the",
"specified",
"format",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/LocalDateEditor.java#L75-L78 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/EnumEditor.java | EnumEditor.getAsText | public String getAsText() {
Enum<?> value = (Enum<?>) getValue();
if (value == null) {
return "";
}
String text = getMessagesAccessor().getMessage(messagesKeyPrefix + value.name(), (String) null);
if (text == null) {
return value.toString();
... | java | public String getAsText() {
Enum<?> value = (Enum<?>) getValue();
if (value == null) {
return "";
}
String text = getMessagesAccessor().getMessage(messagesKeyPrefix + value.name(), (String) null);
if (text == null) {
return value.toString();
... | [
"public",
"String",
"getAsText",
"(",
")",
"{",
"Enum",
"<",
"?",
">",
"value",
"=",
"(",
"Enum",
"<",
"?",
">",
")",
"getValue",
"(",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"String",
"text",
"=",
"get... | Format the Enum as translated String | [
"Format",
"the",
"Enum",
"as",
"translated",
"String"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/EnumEditor.java#L64-L76 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/EnumEditor.java | EnumEditor.setAsText | public void setAsText(String text) throws IllegalArgumentException {
if (text == null || text.equals("")) {
setValue(null);
return;
}
Enum<?> value = Enum.valueOf(enumClass, text);
setValue(value);
} | java | public void setAsText(String text) throws IllegalArgumentException {
if (text == null || text.equals("")) {
setValue(null);
return;
}
Enum<?> value = Enum.valueOf(enumClass, text);
setValue(value);
} | [
"public",
"void",
"setAsText",
"(",
"String",
"text",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"text",
"==",
"null",
"||",
"text",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"setValue",
"(",
"null",
")",
";",
"return",
";",
"}",
"Enum... | Parse the value from the given text is not supported by this editor | [
"Parse",
"the",
"value",
"from",
"the",
"given",
"text",
"is",
"not",
"supported",
"by",
"this",
"editor"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/EnumEditor.java#L81-L88 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/context/ServiceContext.java | ServiceContext.getPropertyKeys | public synchronized Iterator<String> getPropertyKeys() {
if (properties == null) {
properties = new HashMap<String, Serializable>();
}
return properties.keySet().iterator();
} | java | public synchronized Iterator<String> getPropertyKeys() {
if (properties == null) {
properties = new HashMap<String, Serializable>();
}
return properties.keySet().iterator();
} | [
"public",
"synchronized",
"Iterator",
"<",
"String",
">",
"getPropertyKeys",
"(",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Serializable",
">",
"(",
")",
";",
"}",
"return",
"prop... | Gets all property keys for attributes of the ServiceContext object
@return property key values, String elements | [
"Gets",
"all",
"property",
"keys",
"for",
"attributes",
"of",
"the",
"ServiceContext",
"object"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/context/ServiceContext.java#L150-L155 | train |
sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/RouteSpecification.java | RouteSpecification.forCargo | public static RouteSpecification forCargo(Cargo cargo, DateTime arrivalDeadline) {
Validate.notNull(cargo);
Validate.notNull(arrivalDeadline);
return new RouteSpecification(arrivalDeadline, cargo.getOrigin(), cargo.getDestination());
} | java | public static RouteSpecification forCargo(Cargo cargo, DateTime arrivalDeadline) {
Validate.notNull(cargo);
Validate.notNull(arrivalDeadline);
return new RouteSpecification(arrivalDeadline, cargo.getOrigin(), cargo.getDestination());
} | [
"public",
"static",
"RouteSpecification",
"forCargo",
"(",
"Cargo",
"cargo",
",",
"DateTime",
"arrivalDeadline",
")",
"{",
"Validate",
".",
"notNull",
"(",
"cargo",
")",
";",
"Validate",
".",
"notNull",
"(",
"arrivalDeadline",
")",
";",
"return",
"new",
"Route... | Factory for creatig a route specification for a cargo, from cargo
origin to cargo destination. Use for initial routing.
@param cargo cargo
@param arrivalDeadline arrival deadline
@return A route specification for this cargo and arrival deadline | [
"Factory",
"for",
"creatig",
"a",
"route",
"specification",
"for",
"a",
"cargo",
"from",
"cargo",
"origin",
"to",
"cargo",
"destination",
".",
"Use",
"for",
"initial",
"routing",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/RouteSpecification.java#L28-L33 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/SystemException.java | SystemException.unwrapSystemException | public static SystemException unwrapSystemException(Throwable throwable) {
if (throwable == null) {
return null;
} else if (throwable instanceof SystemException) {
return (SystemException) throwable;
} else if (throwable.getCause() != null) {
// recursiv... | java | public static SystemException unwrapSystemException(Throwable throwable) {
if (throwable == null) {
return null;
} else if (throwable instanceof SystemException) {
return (SystemException) throwable;
} else if (throwable.getCause() != null) {
// recursiv... | [
"public",
"static",
"SystemException",
"unwrapSystemException",
"(",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"throwable",
"instanceof",
"SystemException",
")",
"{",
"ret... | Looks for SystemException in the cause chain.
@return Found SystemException in the cause chain, or null if none found | [
"Looks",
"for",
"SystemException",
"in",
"the",
"cause",
"chain",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/SystemException.java#L126-L138 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/ChunkFetcherBase.java | ChunkFetcherBase.getDomainObjectsAsList | public List<T> getDomainObjectsAsList(Set<? extends KEY> keys) {
// it is not "possible" to use huge number of parameters in a
// Restrictions.in criterion and therefore we chunk the query
// into pieces
List<T> all = new ArrayList<T>();
Iterator<? extends KEY> iter = keys.i... | java | public List<T> getDomainObjectsAsList(Set<? extends KEY> keys) {
// it is not "possible" to use huge number of parameters in a
// Restrictions.in criterion and therefore we chunk the query
// into pieces
List<T> all = new ArrayList<T>();
Iterator<? extends KEY> iter = keys.i... | [
"public",
"List",
"<",
"T",
">",
"getDomainObjectsAsList",
"(",
"Set",
"<",
"?",
"extends",
"KEY",
">",
"keys",
")",
"{",
"// it is not \"possible\" to use huge number of parameters in a\r",
"// Restrictions.in criterion and therefore we chunk the query\r",
"// into pieces\r",
... | Fetch existing domain objects based on natural keys
@param keys
Set of natural keys for the domain objects to fetch
@param resultAsSet
indicates if the keys are unique or not, eg. the resulting map
must be a set of objects.
@return Map with keys and domain objects | [
"Fetch",
"existing",
"domain",
"objects",
"based",
"on",
"natural",
"keys"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/ChunkFetcherBase.java#L71-L92 | train |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GeneratorMojo.java | GeneratorMojo.executeGenerator | protected boolean executeGenerator() throws MojoExecutionException {
// Add resources and output directory to plugins classpath
List<Object> classpathEntries = new ArrayList<Object>();
classpathEntries.addAll(project.getResources());
classpathEntries.add(project.getBuild().getOutputDirectory());
extendPlugin... | java | protected boolean executeGenerator() throws MojoExecutionException {
// Add resources and output directory to plugins classpath
List<Object> classpathEntries = new ArrayList<Object>();
classpathEntries.addAll(project.getResources());
classpathEntries.add(project.getBuild().getOutputDirectory());
extendPlugin... | [
"protected",
"boolean",
"executeGenerator",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"// Add resources and output directory to plugins classpath",
"List",
"<",
"Object",
">",
"classpathEntries",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"clas... | Executes the commandline running the Eclipse MWE2 launcher and returns
the commandlines exit value. | [
"Executes",
"the",
"commandline",
"running",
"the",
"Eclipse",
"MWE2",
"launcher",
"and",
"returns",
"the",
"commandlines",
"exit",
"value",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GeneratorMojo.java#L408-L458 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/Option.java | Option.createOptions | public static <T> List<Option<T>> createOptions(Collection<T> domainObjects) {
List<Option<T>> options = new ArrayList<Option<T>>();
for (T value : domainObjects) {
String id = String.valueOf(getId(value));
options.add(new Option<T>(id, value));
}
... | java | public static <T> List<Option<T>> createOptions(Collection<T> domainObjects) {
List<Option<T>> options = new ArrayList<Option<T>>();
for (T value : domainObjects) {
String id = String.valueOf(getId(value));
options.add(new Option<T>(id, value));
}
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"Option",
"<",
"T",
">",
">",
"createOptions",
"(",
"Collection",
"<",
"T",
">",
"domainObjects",
")",
"{",
"List",
"<",
"Option",
"<",
"T",
">>",
"options",
"=",
"new",
"ArrayList",
"<",
"Option",
"<",... | Factory method to create a list of Options from a list of
DomainObjects. It is expected that the DomainObjects has | [
"Factory",
"method",
"to",
"create",
"a",
"list",
"of",
"Options",
"from",
"a",
"list",
"of",
"DomainObjects",
".",
"It",
"is",
"expected",
"that",
"the",
"DomainObjects",
"has"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/Option.java#L27-L36 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/DynamicMethodDispatcher.java | DynamicMethodDispatcher.dispatch | public static void dispatch(Object target, Event event, String methodName) {
try {
MethodUtils.invokeMethod(target, methodName, event);
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof RuntimeException) {
throw (RuntimeException) e.get... | java | public static void dispatch(Object target, Event event, String methodName) {
try {
MethodUtils.invokeMethod(target, methodName, event);
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof RuntimeException) {
throw (RuntimeException) e.get... | [
"public",
"static",
"void",
"dispatch",
"(",
"Object",
"target",
",",
"Event",
"event",
",",
"String",
"methodName",
")",
"{",
"try",
"{",
"MethodUtils",
".",
"invokeMethod",
"(",
"target",
",",
"methodName",
",",
"event",
")",
";",
"}",
"catch",
"(",
"I... | Runtime dispatch to method with correct event parameter type | [
"Runtime",
"dispatch",
"to",
"method",
"with",
"correct",
"event",
"parameter",
"type"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/event/DynamicMethodDispatcher.java#L28-L42 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-mongodb/src/main/java/org/sculptor/framework/accessimpl/mongodb/MongoDbAccessBaseWithException.java | MongoDbAccessBaseWithException.getDataMapper | @SuppressWarnings("unchecked")
public DataMapper<Object, DBObject> getDataMapper(Class<?> domainObjectClass) {
if (additionalDataMappers != null) {
for (DataMapper<Object, DBObject> each : additionalDataMappers) {
if (each.canMapToData(domainObjectClass)) {
... | java | @SuppressWarnings("unchecked")
public DataMapper<Object, DBObject> getDataMapper(Class<?> domainObjectClass) {
if (additionalDataMappers != null) {
for (DataMapper<Object, DBObject> each : additionalDataMappers) {
if (each.canMapToData(domainObjectClass)) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"DataMapper",
"<",
"Object",
",",
"DBObject",
">",
"getDataMapper",
"(",
"Class",
"<",
"?",
">",
"domainObjectClass",
")",
"{",
"if",
"(",
"additionalDataMappers",
"!=",
"null",
")",
"{",
"for",
"... | Matching DataMapper, if any, otherwise null | [
"Matching",
"DataMapper",
"if",
"any",
"otherwise",
"null"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-mongodb/src/main/java/org/sculptor/framework/accessimpl/mongodb/MongoDbAccessBaseWithException.java#L79-L93 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/OptionEditor.java | OptionEditor.getAsText | public String getAsText() {
Object value = getValue();
if (value == null) {
return "";
}
String propertyName = null; // used in error handling below
try {
StringBuffer label = new StringBuffer();
for (int i = 0; i < properties.len... | java | public String getAsText() {
Object value = getValue();
if (value == null) {
return "";
}
String propertyName = null; // used in error handling below
try {
StringBuffer label = new StringBuffer();
for (int i = 0; i < properties.len... | [
"public",
"String",
"getAsText",
"(",
")",
"{",
"Object",
"value",
"=",
"getValue",
"(",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"String",
"propertyName",
"=",
"null",
";",
"// used in error handling below\r",
"try... | Format the Object as String of concatenated properties. | [
"Format",
"the",
"Object",
"as",
"String",
"of",
"concatenated",
"properties",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/OptionEditor.java#L66-L103 | train |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractGeneratorMojo.java | AbstractGeneratorMojo.cleanDirectory | private void cleanDirectory(File dir) {
if (isVerbose() || getLog().isDebugEnabled()) {
getLog().info("Deleting previously generated files in directory: " + dir.getPath());
}
if (dir.exists()) {
try {
FileUtils.cleanDirectory(dir);
} catch (IOException e) {
getLog().warn("Cleaning directory faile... | java | private void cleanDirectory(File dir) {
if (isVerbose() || getLog().isDebugEnabled()) {
getLog().info("Deleting previously generated files in directory: " + dir.getPath());
}
if (dir.exists()) {
try {
FileUtils.cleanDirectory(dir);
} catch (IOException e) {
getLog().warn("Cleaning directory faile... | [
"private",
"void",
"cleanDirectory",
"(",
"File",
"dir",
")",
"{",
"if",
"(",
"isVerbose",
"(",
")",
"||",
"getLog",
"(",
")",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Deleting previously generated files in director... | Deletes all files within the given directory. | [
"Deletes",
"all",
"files",
"within",
"the",
"given",
"directory",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractGeneratorMojo.java#L334-L345 | train |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractGeneratorMojo.java | AbstractGeneratorMojo.getProjectRelativePath | protected String getProjectRelativePath(File file) {
String path = file.getAbsolutePath();
String prefix = project.getBasedir().getAbsolutePath();
if (path.startsWith(prefix)) {
path = path.substring(prefix.length() + 1);
}
if (File.separatorChar != '/') {
path = path.replace(File.separatorChar, '/');
... | java | protected String getProjectRelativePath(File file) {
String path = file.getAbsolutePath();
String prefix = project.getBasedir().getAbsolutePath();
if (path.startsWith(prefix)) {
path = path.substring(prefix.length() + 1);
}
if (File.separatorChar != '/') {
path = path.replace(File.separatorChar, '/');
... | [
"protected",
"String",
"getProjectRelativePath",
"(",
"File",
"file",
")",
"{",
"String",
"path",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"prefix",
"=",
"project",
".",
"getBasedir",
"(",
")",
".",
"getAbsolutePath",
"(",
")",
";",
"i... | Returns the path of given file relative to the enclosing Maven project. | [
"Returns",
"the",
"path",
"of",
"given",
"file",
"relative",
"to",
"the",
"enclosing",
"Maven",
"project",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractGeneratorMojo.java#L350-L360 | train |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractGeneratorMojo.java | AbstractGeneratorMojo.calculateChecksum | private String calculateChecksum(File file) throws IOException {
InputStream is = new FileInputStream(file);
return DigestUtils.md5Hex(is);
} | java | private String calculateChecksum(File file) throws IOException {
InputStream is = new FileInputStream(file);
return DigestUtils.md5Hex(is);
} | [
"private",
"String",
"calculateChecksum",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"return",
"DigestUtils",
".",
"md5Hex",
"(",
"is",
")",
";",
"}"
] | Returns a hex representation of the MD5 checksum from given file. | [
"Returns",
"a",
"hex",
"representation",
"of",
"the",
"MD5",
"checksum",
"from",
"given",
"file",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractGeneratorMojo.java#L365-L368 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java | PropertiesBase.initDerivedDefaults | @Inject
private void initDerivedDefaults(@Named("Mutable Defaults") MutableConfigurationProvider defaultConfiguration) {
if (hasProperty("test.dbunit.dataSetFile")) {
// don't generate data set file for each service/consumer
defaultConfiguration.setBoolean("generate.test.dbunitTestData", false);
}
// dep... | java | @Inject
private void initDerivedDefaults(@Named("Mutable Defaults") MutableConfigurationProvider defaultConfiguration) {
if (hasProperty("test.dbunit.dataSetFile")) {
// don't generate data set file for each service/consumer
defaultConfiguration.setBoolean("generate.test.dbunitTestData", false);
}
// dep... | [
"@",
"Inject",
"private",
"void",
"initDerivedDefaults",
"(",
"@",
"Named",
"(",
"\"Mutable Defaults\"",
")",
"MutableConfigurationProvider",
"defaultConfiguration",
")",
"{",
"if",
"(",
"hasProperty",
"(",
"\"test.dbunit.dataSetFile\"",
")",
")",
"{",
"// don't generat... | Prepare the default values with values inherited from the configuration. | [
"Prepare",
"the",
"default",
"values",
"with",
"values",
"inherited",
"from",
"the",
"configuration",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java#L49-L114 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java | PropertiesBase.getProperties | Properties getProperties(String prefix, boolean removePrefix) {
Properties result = new Properties();
for (String key : getPropertyNames()) {
if (key.startsWith(prefix)) {
result.put((removePrefix) ? key.substring(prefix.length()) : key, getProperty(key));
}
}
return result;
} | java | Properties getProperties(String prefix, boolean removePrefix) {
Properties result = new Properties();
for (String key : getPropertyNames()) {
if (key.startsWith(prefix)) {
result.put((removePrefix) ? key.substring(prefix.length()) : key, getProperty(key));
}
}
return result;
} | [
"Properties",
"getProperties",
"(",
"String",
"prefix",
",",
"boolean",
"removePrefix",
")",
"{",
"Properties",
"result",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"getPropertyNames",
"(",
")",
")",
"{",
"if",
"(",
"key",
... | Gets all properties with a key starting with prefix.
@param prefix
@param removePrefix
remove prefix in the resulting properties or not
@return properties starting with prefix | [
"Gets",
"all",
"properties",
"with",
"a",
"key",
"starting",
"with",
"prefix",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java#L285-L293 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java | PropertiesBase.mapValidationAnnotation | public String mapValidationAnnotation(String annotation, String defaultAnnotation) {
String key = "validation.annotation." + toFirstUpper(annotation);
if (hasProperty(key)) {
return getProperty(key);
} else {
return defaultAnnotation;
}
} | java | public String mapValidationAnnotation(String annotation, String defaultAnnotation) {
String key = "validation.annotation." + toFirstUpper(annotation);
if (hasProperty(key)) {
return getProperty(key);
} else {
return defaultAnnotation;
}
} | [
"public",
"String",
"mapValidationAnnotation",
"(",
"String",
"annotation",
",",
"String",
"defaultAnnotation",
")",
"{",
"String",
"key",
"=",
"\"validation.annotation.\"",
"+",
"toFirstUpper",
"(",
"annotation",
")",
";",
"if",
"(",
"hasProperty",
"(",
"key",
")... | Gets a single validation annotation from properties.
@param annotation
shortcut for annotation
@param defaultAnnotation
default annotation in case annotation could not be found
@return fully qualified Annotation Class (without leading @) | [
"Gets",
"a",
"single",
"validation",
"annotation",
"from",
"properties",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java#L546-L553 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java | PropertiesBase.getAllPConfigurationKeyValues | private List<String> getAllPConfigurationKeyValues(ConfigurationProvider configuration) {
List<String> keyValues = new ArrayList<String>();
for (String key : configuration.keys()) {
keyValues.add(key + "=\"" + configuration.getString(key) + "\"");
}
Collections.sort(keyValues);
return keyValues;
} | java | private List<String> getAllPConfigurationKeyValues(ConfigurationProvider configuration) {
List<String> keyValues = new ArrayList<String>();
for (String key : configuration.keys()) {
keyValues.add(key + "=\"" + configuration.getString(key) + "\"");
}
Collections.sort(keyValues);
return keyValues;
} | [
"private",
"List",
"<",
"String",
">",
"getAllPConfigurationKeyValues",
"(",
"ConfigurationProvider",
"configuration",
")",
"{",
"List",
"<",
"String",
">",
"keyValues",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"key",
... | Returns a sorted list of all key-value pairs defined in given configuration instance. | [
"Returns",
"a",
"sorted",
"list",
"of",
"all",
"key",
"-",
"value",
"pairs",
"defined",
"in",
"given",
"configuration",
"instance",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/PropertiesBase.java#L578-L585 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ExceptionHelper.java | ExceptionHelper.unwrapSQLException | public static SQLException unwrapSQLException(Throwable throwable) {
if (throwable == null) {
return null;
} else if (throwable instanceof SQLException) {
return (SQLException) throwable;
} else if (throwable.getCause() != null) {
// recursive call to un... | java | public static SQLException unwrapSQLException(Throwable throwable) {
if (throwable == null) {
return null;
} else if (throwable instanceof SQLException) {
return (SQLException) throwable;
} else if (throwable.getCause() != null) {
// recursive call to un... | [
"public",
"static",
"SQLException",
"unwrapSQLException",
"(",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"throwable",
"instanceof",
"SQLException",
")",
"{",
"return",
"... | Looks for SQLException in the cause chain.
@return Found SQLException in the cause chain, or null if none found | [
"Looks",
"for",
"SQLException",
"in",
"the",
"cause",
"chain",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ExceptionHelper.java#L19-L31 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/AuditListener.java | AuditListener.changeAuditInformation | @PreUpdate
@PrePersist
private void changeAuditInformation(Auditable auditableEntity) {
Timestamp lastUpdated = new Timestamp(System.currentTimeMillis());
auditableEntity.setLastUpdated(lastUpdated);
String lastUpdatedBy = ServiceContextStore.getCurrentUser();
auditableEnti... | java | @PreUpdate
@PrePersist
private void changeAuditInformation(Auditable auditableEntity) {
Timestamp lastUpdated = new Timestamp(System.currentTimeMillis());
auditableEntity.setLastUpdated(lastUpdated);
String lastUpdatedBy = ServiceContextStore.getCurrentUser();
auditableEnti... | [
"@",
"PreUpdate",
"@",
"PrePersist",
"private",
"void",
"changeAuditInformation",
"(",
"Auditable",
"auditableEntity",
")",
"{",
"Timestamp",
"lastUpdated",
"=",
"new",
"Timestamp",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"auditableEntity",
".... | set audit informations, doesn't modify createdDate and createdBy once set.
Only works with DomainObjects that implement the Auditable interface. In other cases
a IllegalArgumentException is thrown.
@param entity
@return | [
"set",
"audit",
"informations",
"doesn",
"t",
"modify",
"createdDate",
"and",
"createdBy",
"once",
"set",
".",
"Only",
"works",
"with",
"DomainObjects",
"that",
"implement",
"the",
"Auditable",
"interface",
".",
"In",
"other",
"cases",
"a",
"IllegalArgumentExcepti... | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/AuditListener.java#L49-L60 | train |
sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Itinerary.java | Itinerary.isExpected | public boolean isExpected(final HandlingEvent event) {
if (getLegs().isEmpty()) {
return true;
}
if (event.getType() == Type.RECEIVE) {
// Check that the first leg's origin is the event's location
final Leg leg = getLegs().get(0);
return (leg.getFrom().equals(event.getLocation()));
}
if (event.g... | java | public boolean isExpected(final HandlingEvent event) {
if (getLegs().isEmpty()) {
return true;
}
if (event.getType() == Type.RECEIVE) {
// Check that the first leg's origin is the event's location
final Leg leg = getLegs().get(0);
return (leg.getFrom().equals(event.getLocation()));
}
if (event.g... | [
"public",
"boolean",
"isExpected",
"(",
"final",
"HandlingEvent",
"event",
")",
"{",
"if",
"(",
"getLegs",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"event",
".",
"getType",
"(",
")",
"==",
"Type",
".",
"R... | Test if the given handling event is expected when executing this
itinerary.
@param event
Event to test.
@return <code>true</code> if the event is expected | [
"Test",
"if",
"the",
"given",
"handling",
"event",
"is",
"expected",
"when",
"executing",
"this",
"itinerary",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Itinerary.java#L47-L91 | train |
sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java | Cargo.attachItinerary | public void attachItinerary(final Itinerary itinerary) {
Validate.notNull(itinerary);
// Decouple the old itinerary from this cargo
itinerary().setCargo(null);
// Couple this cargo and the new itinerary
setItinerary(itinerary);
itinerary().setCargo(this);
} | java | public void attachItinerary(final Itinerary itinerary) {
Validate.notNull(itinerary);
// Decouple the old itinerary from this cargo
itinerary().setCargo(null);
// Couple this cargo and the new itinerary
setItinerary(itinerary);
itinerary().setCargo(this);
} | [
"public",
"void",
"attachItinerary",
"(",
"final",
"Itinerary",
"itinerary",
")",
"{",
"Validate",
".",
"notNull",
"(",
"itinerary",
")",
";",
"// Decouple the old itinerary from this cargo",
"itinerary",
"(",
")",
".",
"setCargo",
"(",
"null",
")",
";",
"// Coupl... | Attach a new itinerary to this cargo.
@param itinerary
an itinerary. May not be null. | [
"Attach",
"a",
"new",
"itinerary",
"to",
"this",
"cargo",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java#L86-L94 | train |
sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java | Cargo.nullSafe | private <T> T nullSafe(T actual, T safe) {
return actual == null ? safe : actual;
} | java | private <T> T nullSafe(T actual, T safe) {
return actual == null ? safe : actual;
} | [
"private",
"<",
"T",
">",
"T",
"nullSafe",
"(",
"T",
"actual",
",",
"T",
"safe",
")",
"{",
"return",
"actual",
"==",
"null",
"?",
"safe",
":",
"actual",
";",
"}"
] | Utility for Null Object Pattern - should be moved out of this class | [
"Utility",
"for",
"Null",
"Object",
"Pattern",
"-",
"should",
"be",
"moved",
"out",
"of",
"this",
"class"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java#L141-L143 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/JodaAuditListener.java | JodaAuditListener.changeAuditInformation | @PreUpdate
@PrePersist
private void changeAuditInformation(JodaAuditable auditableEntity) {
DateTime lastUpdated = new DateTime();
auditableEntity.setLastUpdated(lastUpdated);
String lastUpdatedBy = ServiceContextStore.getCurrentUser();
auditableEntity.setLastUpdatedBy(lastUpd... | java | @PreUpdate
@PrePersist
private void changeAuditInformation(JodaAuditable auditableEntity) {
DateTime lastUpdated = new DateTime();
auditableEntity.setLastUpdated(lastUpdated);
String lastUpdatedBy = ServiceContextStore.getCurrentUser();
auditableEntity.setLastUpdatedBy(lastUpd... | [
"@",
"PreUpdate",
"@",
"PrePersist",
"private",
"void",
"changeAuditInformation",
"(",
"JodaAuditable",
"auditableEntity",
")",
"{",
"DateTime",
"lastUpdated",
"=",
"new",
"DateTime",
"(",
")",
";",
"auditableEntity",
".",
"setLastUpdated",
"(",
"lastUpdated",
")",
... | set audit informations, doesn't modify createdDate and createdBy once
set. Only works with DomainObjects that implement the JodaAuditable
interface. In other cases a IllegalArgumentException is thrown.
@param entity
@return | [
"set",
"audit",
"informations",
"doesn",
"t",
"modify",
"createdDate",
"and",
"createdBy",
"once",
"set",
".",
"Only",
"works",
"with",
"DomainObjects",
"that",
"implement",
"the",
"JodaAuditable",
"interface",
".",
"In",
"other",
"cases",
"a",
"IllegalArgumentExc... | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/JodaAuditListener.java#L47-L58 | train |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractLogOutputStream.java | AbstractLogOutputStream.processLine | @Override
protected final void processLine(String line, int level) {
boolean isError = doProcessLine(line, level);
if (isErrorStream || isError) {
errorCount++;
}
lineCount++;
} | java | @Override
protected final void processLine(String line, int level) {
boolean isError = doProcessLine(line, level);
if (isErrorStream || isError) {
errorCount++;
}
lineCount++;
} | [
"@",
"Override",
"protected",
"final",
"void",
"processLine",
"(",
"String",
"line",
",",
"int",
"level",
")",
"{",
"boolean",
"isError",
"=",
"doProcessLine",
"(",
"line",
",",
"level",
")",
";",
"if",
"(",
"isErrorStream",
"||",
"isError",
")",
"{",
"e... | Depending on stream type the given line is logged and the correspondig
counter is increased. | [
"Depending",
"on",
"stream",
"type",
"the",
"given",
"line",
"is",
"logged",
"and",
"the",
"correspondig",
"counter",
"is",
"increased",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractLogOutputStream.java#L59-L66 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ErrorHandlingInterceptor.java | ErrorHandlingInterceptor.afterThrowing | public void afterThrowing(Method m, Object[] args, Object target, ConstraintViolationException e) {
Logger log = LoggerFactory.getLogger(target.getClass());
StringBuilder logText = new StringBuilder(excMessage(e));
if (e.getConstraintViolations() != null && e.getConstraintViolations().siz... | java | public void afterThrowing(Method m, Object[] args, Object target, ConstraintViolationException e) {
Logger log = LoggerFactory.getLogger(target.getClass());
StringBuilder logText = new StringBuilder(excMessage(e));
if (e.getConstraintViolations() != null && e.getConstraintViolations().siz... | [
"public",
"void",
"afterThrowing",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
",",
"Object",
"target",
",",
"ConstraintViolationException",
"e",
")",
"{",
"Logger",
"log",
"=",
"LoggerFactory",
".",
"getLogger",
"(",
"target",
".",
"getClass",
"(",... | Handles validation exception | [
"Handles",
"validation",
"exception"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ErrorHandlingInterceptor.java#L96-L126 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getCollectionInterfaceType | public String getCollectionInterfaceType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionInterfaceType(collectionType);
} | java | public String getCollectionInterfaceType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionInterfaceType(collectionType);
} | [
"public",
"String",
"getCollectionInterfaceType",
"(",
"Reference",
"ref",
")",
"{",
"String",
"collectionType",
"=",
"getRefCollectionType",
"(",
"ref",
")",
";",
"return",
"getCollectionInterfaceType",
"(",
"collectionType",
")",
";",
"}"
] | Java interface for the collection type.
@see #getCollectionType(sculptormetamodel.Reference) | [
"Java",
"interface",
"for",
"the",
"collection",
"type",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L430-L433 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getCollectionImplType | public String getCollectionImplType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionImplType(collectionType);
} | java | public String getCollectionImplType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionImplType(collectionType);
} | [
"public",
"String",
"getCollectionImplType",
"(",
"Reference",
"ref",
")",
"{",
"String",
"collectionType",
"=",
"getRefCollectionType",
"(",
"ref",
")",
";",
"return",
"getCollectionImplType",
"(",
"collectionType",
")",
";",
"}"
] | Java implementation class for the collection type.
@see #getCollectionType(sculptormetamodel.Reference) | [
"Java",
"implementation",
"class",
"for",
"the",
"collection",
"type",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L448-L451 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getRefCollectionType | public String getRefCollectionType(Reference ref) {
String type = ref.getCollectionType();
return (type == null ? "set" : type.toLowerCase());
} | java | public String getRefCollectionType(Reference ref) {
String type = ref.getCollectionType();
return (type == null ? "set" : type.toLowerCase());
} | [
"public",
"String",
"getRefCollectionType",
"(",
"Reference",
"ref",
")",
"{",
"String",
"type",
"=",
"ref",
".",
"getCollectionType",
"(",
")",
";",
"return",
"(",
"type",
"==",
"null",
"?",
"\"set\"",
":",
"type",
".",
"toLowerCase",
"(",
")",
")",
";"... | Collection type can be set, list, bag or map. It corresponds to the
Hibernate collection types. | [
"Collection",
"type",
"can",
"be",
"set",
"list",
"bag",
"or",
"map",
".",
"It",
"corresponds",
"to",
"the",
"Hibernate",
"collection",
"types",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L465-L468 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getGetAccessor | public String getGetAccessor(TypedElement e, String prefix) {
String capName = toFirstUpper(e.getName());
if (prefix != null) {
capName = toFirstUpper(prefix) + capName;
}
// Note that Boolean object type is not named with is prefix (according
// to java beans spec)
String result = isBooleanPrimitiveType... | java | public String getGetAccessor(TypedElement e, String prefix) {
String capName = toFirstUpper(e.getName());
if (prefix != null) {
capName = toFirstUpper(prefix) + capName;
}
// Note that Boolean object type is not named with is prefix (according
// to java beans spec)
String result = isBooleanPrimitiveType... | [
"public",
"String",
"getGetAccessor",
"(",
"TypedElement",
"e",
",",
"String",
"prefix",
")",
"{",
"String",
"capName",
"=",
"toFirstUpper",
"(",
"e",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"prefix",
"!=",
"null",
")",
"{",
"capName",
"=",
"toF... | Get-accessor method name of a property, according to JavaBeans naming
conventions. | [
"Get",
"-",
"accessor",
"method",
"name",
"of",
"a",
"property",
"according",
"to",
"JavaBeans",
"naming",
"conventions",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L479-L488 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.toFirstUpper | public String toFirstUpper(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
} | java | public String toFirstUpper(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
} | [
"public",
"String",
"toFirstUpper",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"name",
";",
"}",
"else",
"{",
"return",
"name",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUp... | First character to upper case. | [
"First",
"character",
"to",
"upper",
"case",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L493-L499 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.toFirstLower | public String toFirstLower(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toLowerCase() + name.substring(1);
}
} | java | public String toFirstLower(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toLowerCase() + name.substring(1);
}
} | [
"public",
"String",
"toFirstLower",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"name",
";",
"}",
"else",
"{",
"return",
"name",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toLo... | First character to lower case. | [
"First",
"character",
"to",
"lower",
"case",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L504-L510 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.substringBefore | public String substringBefore(String string, String pattern) {
if (string == null || pattern == null) {
return string;
}
int pos = string.indexOf(pattern);
if (pos != -1) {
return string.substring(0, pos);
}
return null;
} | java | public String substringBefore(String string, String pattern) {
if (string == null || pattern == null) {
return string;
}
int pos = string.indexOf(pattern);
if (pos != -1) {
return string.substring(0, pos);
}
return null;
} | [
"public",
"String",
"substringBefore",
"(",
"String",
"string",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"pattern",
"==",
"null",
")",
"{",
"return",
"string",
";",
"}",
"int",
"pos",
"=",
"string",
".",
"indexOf",
"... | Gets the substring before a given pattern
@param string
original string
@param pattern
pattern to check
@return substring before the pattern | [
"Gets",
"the",
"substring",
"before",
"a",
"given",
"pattern"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L567-L576 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.addDefaultValues | public void addDefaultValues(Service service) {
for (ServiceOperation op : (List<ServiceOperation>) service.getOperations()) {
addDefaultValues(op);
}
} | java | public void addDefaultValues(Service service) {
for (ServiceOperation op : (List<ServiceOperation>) service.getOperations()) {
addDefaultValues(op);
}
} | [
"public",
"void",
"addDefaultValues",
"(",
"Service",
"service",
")",
"{",
"for",
"(",
"ServiceOperation",
"op",
":",
"(",
"List",
"<",
"ServiceOperation",
">",
")",
"service",
".",
"getOperations",
"(",
")",
")",
"{",
"addDefaultValues",
"(",
"op",
")",
"... | Fill in parameters and return values for operations that delegate to
Repository. | [
"Fill",
"in",
"parameters",
"and",
"return",
"values",
"for",
"operations",
"that",
"delegate",
"to",
"Repository",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L804-L808 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.addDefaultValues | private void addDefaultValues(ServiceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), true);
} else if (operation.getServiceDelegate() != null) {
// make sure that the service delegate has been populated first
addDefaultValues(operation.getS... | java | private void addDefaultValues(ServiceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), true);
} else if (operation.getServiceDelegate() != null) {
// make sure that the service delegate has been populated first
addDefaultValues(operation.getS... | [
"private",
"void",
"addDefaultValues",
"(",
"ServiceOperation",
"operation",
")",
"{",
"if",
"(",
"operation",
".",
"getDelegate",
"(",
")",
"!=",
"null",
")",
"{",
"copyFromDelegate",
"(",
"operation",
",",
"operation",
".",
"getDelegate",
"(",
")",
",",
"t... | Copy values from delegate RepositoryOperation to this ServiceOperation | [
"Copy",
"values",
"from",
"delegate",
"RepositoryOperation",
"to",
"this",
"ServiceOperation"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L813-L823 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.addDefaultValues | private void addDefaultValues(ResourceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), false);
}
} | java | private void addDefaultValues(ResourceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), false);
}
} | [
"private",
"void",
"addDefaultValues",
"(",
"ResourceOperation",
"operation",
")",
"{",
"if",
"(",
"operation",
".",
"getDelegate",
"(",
")",
"!=",
"null",
")",
"{",
"copyFromDelegate",
"(",
"operation",
",",
"operation",
".",
"getDelegate",
"(",
")",
",",
"... | Copy values from delegate ServiceOperation to this ResourceOperation | [
"Copy",
"values",
"from",
"delegate",
"ServiceOperation",
"to",
"this",
"ResourceOperation"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L828-L832 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.handleValidationAnnotations | private String handleValidationAnnotations(String validate) {
if (validate == null)
return "";
if (validate.length() > 15) {
@SuppressWarnings("unused")
boolean baa = true;
}
// parsing the validate string is simple text replacement
validate = validate.replaceAll("&&", " ");
validate = validate.... | java | private String handleValidationAnnotations(String validate) {
if (validate == null)
return "";
if (validate.length() > 15) {
@SuppressWarnings("unused")
boolean baa = true;
}
// parsing the validate string is simple text replacement
validate = validate.replaceAll("&&", " ");
validate = validate.... | [
"private",
"String",
"handleValidationAnnotations",
"(",
"String",
"validate",
")",
"{",
"if",
"(",
"validate",
"==",
"null",
")",
"return",
"\"\"",
";",
"if",
"(",
"validate",
".",
"length",
"(",
")",
">",
"15",
")",
"{",
"@",
"SuppressWarnings",
"(",
"... | Parses the given validation string and tries to map annotations from
properties.
@param validate
String with validation information
@return validation annotations | [
"Parses",
"the",
"given",
"validation",
"string",
"and",
"tries",
"to",
"map",
"annotations",
"from",
"properties",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L1045-L1066 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java | DbHelperBase.isRefInverse | public boolean isRefInverse(Reference ref) {
if (ref.isInverse()) {
return true;
}
if (!ref.isInverse() && (ref.getOpposite() != null) && ref.getOpposite().isInverse()) {
return false;
}
if (ref.getOpposite() == null) {
return false;
}
// inverse not defined on any side, use this algori... | java | public boolean isRefInverse(Reference ref) {
if (ref.isInverse()) {
return true;
}
if (!ref.isInverse() && (ref.getOpposite() != null) && ref.getOpposite().isInverse()) {
return false;
}
if (ref.getOpposite() == null) {
return false;
}
// inverse not defined on any side, use this algori... | [
"public",
"boolean",
"isRefInverse",
"(",
"Reference",
"ref",
")",
"{",
"if",
"(",
"ref",
".",
"isInverse",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"ref",
".",
"isInverse",
"(",
")",
"&&",
"(",
"ref",
".",
"getOpposite",
"("... | Inverse attribute for many-to-many associations. | [
"Inverse",
"attribute",
"for",
"many",
"-",
"to",
"-",
"many",
"associations",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java#L619-L637 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java | DbHelperBase.getAllManyReferences | private List<Reference> getAllManyReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allManyReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (ref.isMany()) {
allManyReferences.add(ref);
}
}
re... | java | private List<Reference> getAllManyReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allManyReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (ref.isMany()) {
allManyReferences.add(ref);
}
}
re... | [
"private",
"List",
"<",
"Reference",
">",
"getAllManyReferences",
"(",
"DomainObject",
"domainObject",
")",
"{",
"List",
"<",
"Reference",
">",
"allReferences",
"=",
"domainObject",
".",
"getReferences",
"(",
")",
";",
"List",
"<",
"Reference",
">",
"allManyRefe... | List of references with multiplicity > 1 | [
"List",
"of",
"references",
"with",
"multiplicity",
">",
"1"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java#L642-L651 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java | DbHelperBase.getAllOneReferences | private List<Reference> getAllOneReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allOneReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (!ref.isMany()) {
allOneReferences.add(ref);
}
}
retu... | java | private List<Reference> getAllOneReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allOneReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (!ref.isMany()) {
allOneReferences.add(ref);
}
}
retu... | [
"private",
"List",
"<",
"Reference",
">",
"getAllOneReferences",
"(",
"DomainObject",
"domainObject",
")",
"{",
"List",
"<",
"Reference",
">",
"allReferences",
"=",
"domainObject",
".",
"getReferences",
"(",
")",
";",
"List",
"<",
"Reference",
">",
"allOneRefere... | List of references with multiplicity = 1 | [
"List",
"of",
"references",
"with",
"multiplicity",
"=",
"1"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java#L656-L665 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/DateTimeEditor.java | DateTimeEditor.getAsText | public String getAsText() {
DateTime value = (DateTime) getValue();
return (value != null ? value.toString(this.formatter) : "");
} | java | public String getAsText() {
DateTime value = (DateTime) getValue();
return (value != null ? value.toString(this.formatter) : "");
} | [
"public",
"String",
"getAsText",
"(",
")",
"{",
"DateTime",
"value",
"=",
"(",
"DateTime",
")",
"getValue",
"(",
")",
";",
"return",
"(",
"value",
"!=",
"null",
"?",
"value",
".",
"toString",
"(",
"this",
".",
"formatter",
")",
":",
"\"\"",
")",
";",... | Format the DateTime as String, using the specified format. | [
"Format",
"the",
"DateTime",
"as",
"String",
"using",
"the",
"specified",
"format",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/DateTimeEditor.java#L75-L78 | train |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/GenericAccessObjectManager.java | GenericAccessObjectManager.getGenericType | public String getGenericType(RepositoryOperation op) {
GenericAccessObjectStrategy strategy = genericAccessObjectStrategies.get(op.getName());
if (strategy == null) {
return "";
} else {
return strategy.getGenericType(op);
}
} | java | public String getGenericType(RepositoryOperation op) {
GenericAccessObjectStrategy strategy = genericAccessObjectStrategies.get(op.getName());
if (strategy == null) {
return "";
} else {
return strategy.getGenericType(op);
}
} | [
"public",
"String",
"getGenericType",
"(",
"RepositoryOperation",
"op",
")",
"{",
"GenericAccessObjectStrategy",
"strategy",
"=",
"genericAccessObjectStrategies",
".",
"get",
"(",
"op",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"strategy",
"==",
"null",
")"... | Get the generic type declaration for generic access objects. | [
"Get",
"the",
"generic",
"type",
"declaration",
"for",
"generic",
"access",
"objects",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/GenericAccessObjectManager.java#L106-L113 | train |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/AbstractDomainObject.java | AbstractDomainObject.acceptToString | protected boolean acceptToString(Field field) {
return acceptedToStringTypes.contains(field.getType())
|| acceptedToStringTypes.contains(field.getType().getName());
} | java | protected boolean acceptToString(Field field) {
return acceptedToStringTypes.contains(field.getType())
|| acceptedToStringTypes.contains(field.getType().getName());
} | [
"protected",
"boolean",
"acceptToString",
"(",
"Field",
"field",
")",
"{",
"return",
"acceptedToStringTypes",
".",
"contains",
"(",
"field",
".",
"getType",
"(",
")",
")",
"||",
"acceptedToStringTypes",
".",
"contains",
"(",
"field",
".",
"getType",
"(",
")",
... | Subclasses may override this method to include or exclude some properties
in toString. By default only "simple" types will be included in toString.
Relations to other domain objects can not be included since we don't know
if they are fetched and we don't wont toString to fetch them.
@param field
the field to include i... | [
"Subclasses",
"may",
"override",
"this",
"method",
"to",
"include",
"or",
"exclude",
"some",
"properties",
"in",
"toString",
".",
"By",
"default",
"only",
"simple",
"types",
"will",
"be",
"included",
"in",
"toString",
".",
"Relations",
"to",
"other",
"domain",... | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/AbstractDomainObject.java#L113-L116 | train |
jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UByte.java | UByte.mkValues | private static final UByte[] mkValues() {
UByte[] ret = new UByte[256];
for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++)
ret[i & MAX_VALUE] = new UByte((byte) i);
return ret;
} | java | private static final UByte[] mkValues() {
UByte[] ret = new UByte[256];
for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++)
ret[i & MAX_VALUE] = new UByte((byte) i);
return ret;
} | [
"private",
"static",
"final",
"UByte",
"[",
"]",
"mkValues",
"(",
")",
"{",
"UByte",
"[",
"]",
"ret",
"=",
"new",
"UByte",
"[",
"256",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"Byte",
".",
"MIN_VALUE",
";",
"i",
"<=",
"Byte",
".",
"MAX_VALUE",
";",... | Generate a cached value for each byte value.
@return Array of cached values for UByte. | [
"Generate",
"a",
"cached",
"value",
"for",
"each",
"byte",
"value",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UByte.java#L74-L81 | train |
jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UInteger.java | UInteger.mkValues | private static final UInteger[] mkValues() {
int precacheSize = getPrecacheSize();
UInteger[] ret;
if (precacheSize <= 0)
return null;
ret = new UInteger[precacheSize];
for (int i = 0; i < precacheSize; i++)
ret[i] = new UInteger(i);
return ret;... | java | private static final UInteger[] mkValues() {
int precacheSize = getPrecacheSize();
UInteger[] ret;
if (precacheSize <= 0)
return null;
ret = new UInteger[precacheSize];
for (int i = 0; i < precacheSize; i++)
ret[i] = new UInteger(i);
return ret;... | [
"private",
"static",
"final",
"UInteger",
"[",
"]",
"mkValues",
"(",
")",
"{",
"int",
"precacheSize",
"=",
"getPrecacheSize",
"(",
")",
";",
"UInteger",
"[",
"]",
"ret",
";",
"if",
"(",
"precacheSize",
"<=",
"0",
")",
"return",
"null",
";",
"ret",
"=",... | Generate a cached value for initial unsigned integer values.
@return Array of cached values for UInteger | [
"Generate",
"a",
"cached",
"value",
"for",
"initial",
"unsigned",
"integer",
"values",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UInteger.java#L137-L149 | train |
jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UInteger.java | UInteger.getCached | private static UInteger getCached(long value) {
if (VALUES != null && value < VALUES.length)
return VALUES[(int) value];
return null;
} | java | private static UInteger getCached(long value) {
if (VALUES != null && value < VALUES.length)
return VALUES[(int) value];
return null;
} | [
"private",
"static",
"UInteger",
"getCached",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"VALUES",
"!=",
"null",
"&&",
"value",
"<",
"VALUES",
".",
"length",
")",
"return",
"VALUES",
"[",
"(",
"int",
")",
"value",
"]",
";",
"return",
"null",
";",
"}"... | Retrieve a cached value.
@param value Cached value to retrieve
@return Cached value if one exists. Null otherwise. | [
"Retrieve",
"a",
"cached",
"value",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UInteger.java#L170-L175 | train |
jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UInteger.java | UInteger.valueOfUnchecked | private static UInteger valueOfUnchecked(long value) {
UInteger cached;
if ((cached = getCached(value)) != null)
return cached;
return new UInteger(value, true);
} | java | private static UInteger valueOfUnchecked(long value) {
UInteger cached;
if ((cached = getCached(value)) != null)
return cached;
return new UInteger(value, true);
} | [
"private",
"static",
"UInteger",
"valueOfUnchecked",
"(",
"long",
"value",
")",
"{",
"UInteger",
"cached",
";",
"if",
"(",
"(",
"cached",
"=",
"getCached",
"(",
"value",
")",
")",
"!=",
"null",
")",
"return",
"cached",
";",
"return",
"new",
"UInteger",
"... | Get the value of a long without checking the value. | [
"Get",
"the",
"value",
"of",
"a",
"long",
"without",
"checking",
"the",
"value",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UInteger.java#L180-L187 | train |
jOOQ/jOOU | jOOU/src/main/java/org/joou/UInteger.java | UInteger.getPrecacheSize | private static final int getPrecacheSize() {
String prop = null;
long propParsed;
try {
prop = System.getProperty(PRECACHE_PROPERTY);
}
catch (SecurityException e) {
// security manager stopped us so use default
// FIXME: should we lo... | java | private static final int getPrecacheSize() {
String prop = null;
long propParsed;
try {
prop = System.getProperty(PRECACHE_PROPERTY);
}
catch (SecurityException e) {
// security manager stopped us so use default
// FIXME: should we lo... | [
"private",
"static",
"final",
"int",
"getPrecacheSize",
"(",
")",
"{",
"String",
"prop",
"=",
"null",
";",
"long",
"propParsed",
";",
"try",
"{",
"prop",
"=",
"System",
".",
"getProperty",
"(",
"PRECACHE_PROPERTY",
")",
";",
"}",
"catch",
"(",
"SecurityExc... | Figure out the size of the precache.
@return The parsed value of the system property
{@link #PRECACHE_PROPERTY} or {@link #DEFAULT_PRECACHE_SIZE} if
the property is not set, not a number or retrieving results in a
{@link SecurityException}. If the parsed value is zero or
negative no cache will be created. If the value... | [
"Figure",
"out",
"the",
"size",
"of",
"the",
"precache",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU/src/main/java/org/joou/UInteger.java#L92-L130 | train |
jOOQ/jOOU | jOOU/src/main/java/org/joou/UInteger.java | UInteger.readResolve | private Object readResolve() throws ObjectStreamException {
UInteger cached;
// the value read could be invalid so check it
rangeCheck(value);
if ((cached = getCached(value)) != null)
return cached;
return this;
} | java | private Object readResolve() throws ObjectStreamException {
UInteger cached;
// the value read could be invalid so check it
rangeCheck(value);
if ((cached = getCached(value)) != null)
return cached;
return this;
} | [
"private",
"Object",
"readResolve",
"(",
")",
"throws",
"ObjectStreamException",
"{",
"UInteger",
"cached",
";",
"// the value read could be invalid so check it\r",
"rangeCheck",
"(",
"value",
")",
";",
"if",
"(",
"(",
"cached",
"=",
"getCached",
"(",
"value",
")",
... | Replace version read through deserialization with cached version.
@return cached instance of this object's value if one exists, otherwise
this object
@throws ObjectStreamException | [
"Replace",
"version",
"read",
"through",
"deserialization",
"with",
"cached",
"version",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU/src/main/java/org/joou/UInteger.java#L268-L277 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/color/ColorReference.java | ColorReference.brighten | public ColorReference brighten(final Float brightness) {
ColorReference copy = copy();
if (copy.brightness == null) {
copy.brightness = brightness;
} else {
copy.brightness += brightness;
}
return copy;
} | java | public ColorReference brighten(final Float brightness) {
ColorReference copy = copy();
if (copy.brightness == null) {
copy.brightness = brightness;
} else {
copy.brightness += brightness;
}
return copy;
} | [
"public",
"ColorReference",
"brighten",
"(",
"final",
"Float",
"brightness",
")",
"{",
"ColorReference",
"copy",
"=",
"copy",
"(",
")",
";",
"if",
"(",
"copy",
".",
"brightness",
"==",
"null",
")",
"{",
"copy",
".",
"brightness",
"=",
"brightness",
";",
... | Brightens this color by the amount given. Returns a copy of this color
object not this object itself.
@param brightness
the amount to brighten (between 0 and 1).
@return a copy of this color object, brightened by the given amount. | [
"Brightens",
"this",
"color",
"by",
"the",
"amount",
"given",
".",
"Returns",
"a",
"copy",
"of",
"this",
"color",
"object",
"not",
"this",
"object",
"itself",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/color/ColorReference.java#L43-L51 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java | PointSeries.addNumberPoint | public PointSeries addNumberPoint(final Number y) {
Point point = new Point(y);
addPoint(point);
return this;
} | java | public PointSeries addNumberPoint(final Number y) {
Point point = new Point(y);
addPoint(point);
return this;
} | [
"public",
"PointSeries",
"addNumberPoint",
"(",
"final",
"Number",
"y",
")",
"{",
"Point",
"point",
"=",
"new",
"Point",
"(",
"y",
")",
";",
"addPoint",
"(",
"point",
")",
";",
"return",
"this",
";",
"}"
] | Adds a point with only a number.
@param y
the number.
@return a PointSeries object with the new Point added | [
"Adds",
"a",
"point",
"with",
"only",
"a",
"number",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java#L40-L44 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java | PointSeries.addNumbers | public PointSeries addNumbers(final List<Number> values) {
for (Number number : values) {
addNumberPoint(number);
}
return this;
} | java | public PointSeries addNumbers(final List<Number> values) {
for (Number number : values) {
addNumberPoint(number);
}
return this;
} | [
"public",
"PointSeries",
"addNumbers",
"(",
"final",
"List",
"<",
"Number",
">",
"values",
")",
"{",
"for",
"(",
"Number",
"number",
":",
"values",
")",
"{",
"addNumberPoint",
"(",
"number",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Adds a list of point with only numbers.
@param values
the number values to add.
@return a PointSeries object with the new points added to it | [
"Adds",
"a",
"list",
"of",
"point",
"with",
"only",
"numbers",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java#L54-L59 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket14/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java | HomepageHighcharts.addCodeContainer | private void addCodeContainer(Chart chart) {
Label codeContainer = new Label("code", new StringFromResourceModel(
chart.getOptions().getClass(), chart.getOptions().getClass().getSimpleName()
+ ".java"));
codeContainer.setOutputMarkupId(true);
add(codeContainer);
... | java | private void addCodeContainer(Chart chart) {
Label codeContainer = new Label("code", new StringFromResourceModel(
chart.getOptions().getClass(), chart.getOptions().getClass().getSimpleName()
+ ".java"));
codeContainer.setOutputMarkupId(true);
add(codeContainer);
... | [
"private",
"void",
"addCodeContainer",
"(",
"Chart",
"chart",
")",
"{",
"Label",
"codeContainer",
"=",
"new",
"Label",
"(",
"\"code\"",
",",
"new",
"StringFromResourceModel",
"(",
"chart",
".",
"getOptions",
"(",
")",
".",
"getClass",
"(",
")",
",",
"chart",... | Adds a code container corresponding to the current chart
@param chart The currently selected chart | [
"Adds",
"a",
"code",
"container",
"corresponding",
"to",
"the",
"current",
"chart"
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket14/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java#L114-L120 | train |
adessoAG/wicked-charts | wicket/wicked-charts-wicket8/src/main/java/de/adesso/wickedcharts/wicket8/highcharts/Chart.java | Chart.setTheme | public void setTheme(final Theme theme) {
if (this.themeReference != null || this.themeUrl != null) {
throw new IllegalStateException(
"A theme can only be defined once. Calling different setTheme methods is not allowed!");
}
this.theme = theme;
} | java | public void setTheme(final Theme theme) {
if (this.themeReference != null || this.themeUrl != null) {
throw new IllegalStateException(
"A theme can only be defined once. Calling different setTheme methods is not allowed!");
}
this.theme = theme;
} | [
"public",
"void",
"setTheme",
"(",
"final",
"Theme",
"theme",
")",
"{",
"if",
"(",
"this",
".",
"themeReference",
"!=",
"null",
"||",
"this",
".",
"themeUrl",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"A theme can only be defined ... | Sets the theme for this chart by specifying a theme class.
A theme can only be set via one setTheme method. An
{@link IllegalStateException} will be thrown if you call two setTheme
methods.
@param theme the theme class. | [
"Sets",
"the",
"theme",
"for",
"this",
"chart",
"by",
"specifying",
"a",
"theme",
"class",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/wicket/wicked-charts-wicket8/src/main/java/de/adesso/wickedcharts/wicket8/highcharts/Chart.java#L149-L155 | train |
adessoAG/wicked-charts | wicket/wicked-charts-wicket6/src/main/java/de/adesso/wickedcharts/wicket6/JavaScriptExpressionSendingAjaxBehavior.java | JavaScriptExpressionSendingAjaxBehavior.getVariableValue | protected StringValue getVariableValue(String parameterName) {
RequestCycle cycle = RequestCycle.get();
WebRequest webRequest = (WebRequest) cycle.getRequest();
StringValue value = webRequest.getRequestParameters().getParameterValue(parameterName);
return value;
} | java | protected StringValue getVariableValue(String parameterName) {
RequestCycle cycle = RequestCycle.get();
WebRequest webRequest = (WebRequest) cycle.getRequest();
StringValue value = webRequest.getRequestParameters().getParameterValue(parameterName);
return value;
} | [
"protected",
"StringValue",
"getVariableValue",
"(",
"String",
"parameterName",
")",
"{",
"RequestCycle",
"cycle",
"=",
"RequestCycle",
".",
"get",
"(",
")",
";",
"WebRequest",
"webRequest",
"=",
"(",
"WebRequest",
")",
"cycle",
".",
"getRequest",
"(",
")",
";... | Reads the value of the given javascript variable from the AJAX request.
@param parameterName the parameter name of the javascript expression whose value to
read. The parameterName must have been specified earlier when
calling {@link #addJavaScriptValue(String, String)}.
@return the string representation of the javascr... | [
"Reads",
"the",
"value",
"of",
"the",
"given",
"javascript",
"variable",
"from",
"the",
"AJAX",
"request",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/wicket/wicked-charts-wicket6/src/main/java/de/adesso/wickedcharts/wicket6/JavaScriptExpressionSendingAjaxBehavior.java#L44-L49 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java | CssStyle.setProperty | public CssStyle setProperty(final String key, final String value) {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
this.properties.put(sanitizeCssPropertyName(key), value);
return this;
} | java | public CssStyle setProperty(final String key, final String value) {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
this.properties.put(sanitizeCssPropertyName(key), value);
return this;
} | [
"public",
"CssStyle",
"setProperty",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"properties",
"==",
"null",
")",
"{",
"this",
".",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
... | Sets a CSS property.
@param key
the name of the property. Note that hyphen notation ("-") is
automatically converted into camel case notation since the
property name is used as key in a JSON object. Highcharts will
evaluate it as if it were hyphen notation.
@param value
the value of the CSS property.
@return this for ... | [
"Sets",
"a",
"CSS",
"property",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java#L66-L72 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java | CssStyle.sanitizeCssPropertyName | private String sanitizeCssPropertyName(final String propertyName) {
if (!propertyName.contains("-")) {
return propertyName;
} else {
String sanitized = propertyName;
int index = sanitized.indexOf('-');
while (index != -1) {
String charToBeReplaced = sanitized.substring(index + 1,... | java | private String sanitizeCssPropertyName(final String propertyName) {
if (!propertyName.contains("-")) {
return propertyName;
} else {
String sanitized = propertyName;
int index = sanitized.indexOf('-');
while (index != -1) {
String charToBeReplaced = sanitized.substring(index + 1,... | [
"private",
"String",
"sanitizeCssPropertyName",
"(",
"final",
"String",
"propertyName",
")",
"{",
"if",
"(",
"!",
"propertyName",
".",
"contains",
"(",
"\"-\"",
")",
")",
"{",
"return",
"propertyName",
";",
"}",
"else",
"{",
"String",
"sanitized",
"=",
"prop... | Replaces hyphen notation with camel case notation.
@param propertyName
the name of the CSS property to sanitize
@return the sanitized CSS property name | [
"Replaces",
"hyphen",
"notation",
"with",
"camel",
"case",
"notation",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java#L81-L95 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket15/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java | HomepageHighcharts.getSelectedTab | private int getSelectedTab() {
String theme = "default";
List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
theme = pairs.get(0).getValue();
if ("grid".equals(theme)) {
return 1;
} else if ("skies".equals(theme)) {
return 2;
... | java | private int getSelectedTab() {
String theme = "default";
List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
theme = pairs.get(0).getValue();
if ("grid".equals(theme)) {
return 1;
} else if ("skies".equals(theme)) {
return 2;
... | [
"private",
"int",
"getSelectedTab",
"(",
")",
"{",
"String",
"theme",
"=",
"\"default\"",
";",
"List",
"<",
"PageParameters",
".",
"NamedPair",
">",
"pairs",
"=",
"getPageParameters",
"(",
")",
".",
"getAllNamed",
"(",
")",
";",
"theme",
"=",
"pairs",
".",... | Used in the renderHead method to highlight the currently
selected theme tab
@return the index of the currently selected theme tab | [
"Used",
"in",
"the",
"renderHead",
"method",
"to",
"highlight",
"the",
"currently",
"selected",
"theme",
"tab"
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket15/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java#L412-L429 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getBrowserData | private List<BrowserUsageData> getBrowserData() {
List<BrowserUsageData> browserData = new ArrayList<BrowserUsageData>();
browserData
.add(getMSIEUsageData());
browserData
.add(getFirefoxUsageData());
browserData
.add(getChromeUsageData());
browserData
.add(getSafariU... | java | private List<BrowserUsageData> getBrowserData() {
List<BrowserUsageData> browserData = new ArrayList<BrowserUsageData>();
browserData
.add(getMSIEUsageData());
browserData
.add(getFirefoxUsageData());
browserData
.add(getChromeUsageData());
browserData
.add(getSafariU... | [
"private",
"List",
"<",
"BrowserUsageData",
">",
"getBrowserData",
"(",
")",
"{",
"List",
"<",
"BrowserUsageData",
">",
"browserData",
"=",
"new",
"ArrayList",
"<",
"BrowserUsageData",
">",
"(",
")",
";",
"browserData",
".",
"add",
"(",
"getMSIEUsageData",
"("... | Creates the data displayed in the donut chart. | [
"Creates",
"the",
"data",
"displayed",
"in",
"the",
"donut",
"chart",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L181-L194 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getChromeUsageData | private BrowserUsageData getChromeUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Chrome");
data
.setMarketShare(11.94f);
ColorReference chromeColor = new HighchartsColor(2);
data
.setColor(chromeColor);
data
.getVersionUsageDat... | java | private BrowserUsageData getChromeUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Chrome");
data
.setMarketShare(11.94f);
ColorReference chromeColor = new HighchartsColor(2);
data
.setColor(chromeColor);
data
.getVersionUsageDat... | [
"private",
"BrowserUsageData",
"getChromeUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Chrome\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"11.94f",
")",
";",
"... | Creates the Chrome data. | [
"Creates",
"the",
"Chrome",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L199-L249 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getFirefoxUsageData | private BrowserUsageData getFirefoxUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Firefox");
data
.setMarketShare(21.63f);
ColorReference ffColor = new HighchartsColor(1);
data
.setColor(ffColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getFirefoxUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Firefox");
data
.setMarketShare(21.63f);
ColorReference ffColor = new HighchartsColor(1);
data
.setColor(ffColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getFirefoxUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Firefox\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"21.63f",
")",
";",
... | Creates the Firefox data. | [
"Creates",
"the",
"Firefox",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L254-L281 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getMSIEUsageData | private BrowserUsageData getMSIEUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("MSIE");
data
.setMarketShare(55.11f);
ColorReference ieColor = new HighchartsColor(0);
data
.setColor(ieColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getMSIEUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("MSIE");
data
.setMarketShare(55.11f);
ColorReference ieColor = new HighchartsColor(0);
data
.setColor(ieColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getMSIEUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"MSIE\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"55.11f",
")",
";",
"Colo... | Creates the Internet Explorer data. | [
"Creates",
"the",
"Internet",
"Explorer",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L286-L308 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getOperaUsageData | private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setColor(operaColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setColor(operaColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getOperaUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Opera\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"2.14f",
")",
";",
"Col... | Creates the Opera data. | [
"Creates",
"the",
"Opera",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L313-L338 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getSafariUsageData | private BrowserUsageData getSafariUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Safari");
data
.setMarketShare(7.15f);
ColorReference safariColor = new HighchartsColor(3);
data
.setColor(safariColor);
data
.getVersionUsageData... | java | private BrowserUsageData getSafariUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Safari");
data
.setMarketShare(7.15f);
ColorReference safariColor = new HighchartsColor(3);
data
.setColor(safariColor);
data
.getVersionUsageData... | [
"private",
"BrowserUsageData",
"getSafariUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Safari\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"7.15f",
")",
";",
"C... | Creates the Safari data. | [
"Creates",
"the",
"Safari",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L343-L388 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket7/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java | HomepageHighcharts.renderHead | @Override
public void renderHead(final IHeaderResponse response) {
// select bootstrap tab for current theme selected
int selectedTab = this.getSelectedTab();
response.render(OnDomReadyHeaderItem.forScript("$('#themes li:eq("
+ selectedTab + ") a').tab('show');"));
} | java | @Override
public void renderHead(final IHeaderResponse response) {
// select bootstrap tab for current theme selected
int selectedTab = this.getSelectedTab();
response.render(OnDomReadyHeaderItem.forScript("$('#themes li:eq("
+ selectedTab + ") a').tab('show');"));
} | [
"@",
"Override",
"public",
"void",
"renderHead",
"(",
"final",
"IHeaderResponse",
"response",
")",
"{",
"// select bootstrap tab for current theme selected",
"int",
"selectedTab",
"=",
"this",
".",
"getSelectedTab",
"(",
")",
";",
"response",
".",
"render",
"(",
"On... | Highlights the currently selected theme tab
@param response . | [
"Highlights",
"the",
"currently",
"selected",
"theme",
"tab"
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket7/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java#L452-L458 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/jackson/JsonRenderer.java | JsonRenderer.addSerializer | public <T> void addSerializer(final Class<T> clazz, final JsonSerializer<T> serializer) {
this.jacksonModule.addSerializer(clazz, serializer);
} | java | public <T> void addSerializer(final Class<T> clazz, final JsonSerializer<T> serializer) {
this.jacksonModule.addSerializer(clazz, serializer);
} | [
"public",
"<",
"T",
">",
"void",
"addSerializer",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"JsonSerializer",
"<",
"T",
">",
"serializer",
")",
"{",
"this",
".",
"jacksonModule",
".",
"addSerializer",
"(",
"clazz",
",",
"serializer",
"... | This method gives the opportunity to add a custom serializer to serializer
one of the highchart option classes. It may be neccessary to serialize
certain option classes differently for different web frameworks.
@param clazz the option class
@param serializer the serializer responsible for serializing objects of t... | [
"This",
"method",
"gives",
"the",
"opportunity",
"to",
"add",
"a",
"custom",
"serializer",
"to",
"serializer",
"one",
"of",
"the",
"highchart",
"option",
"classes",
".",
"It",
"may",
"be",
"neccessary",
"to",
"serialize",
"certain",
"option",
"classes",
"diffe... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/jackson/JsonRenderer.java#L65-L67 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/Series.java | Series.addPoint | public Series<D> addPoint(final D point) {
if (this.data == null) {
this.data = new ArrayList<D>();
}
this.data.add(point);
return this;
} | java | public Series<D> addPoint(final D point) {
if (this.data == null) {
this.data = new ArrayList<D>();
}
this.data.add(point);
return this;
} | [
"public",
"Series",
"<",
"D",
">",
"addPoint",
"(",
"final",
"D",
"point",
")",
"{",
"if",
"(",
"this",
".",
"data",
"==",
"null",
")",
"{",
"this",
".",
"data",
"=",
"new",
"ArrayList",
"<",
"D",
">",
"(",
")",
";",
"}",
"this",
".",
"data",
... | Adds a point to this series.
@param point
the point to add.
@return a Series of points with the new point added to it | [
"Adds",
"a",
"point",
"to",
"this",
"series",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/Series.java#L112-L118 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.setRenderTo | public void setRenderTo(final Options options, final String renderTo) {
if (options.getChartOptions() == null) {
options.setChartOptions(new ChartOptions());
}
options.getChartOptions().setRenderTo(renderTo);
} | java | public void setRenderTo(final Options options, final String renderTo) {
if (options.getChartOptions() == null) {
options.setChartOptions(new ChartOptions());
}
options.getChartOptions().setRenderTo(renderTo);
} | [
"public",
"void",
"setRenderTo",
"(",
"final",
"Options",
"options",
",",
"final",
"String",
"renderTo",
")",
"{",
"if",
"(",
"options",
".",
"getChartOptions",
"(",
")",
"==",
"null",
")",
"{",
"options",
".",
"setChartOptions",
"(",
"new",
"ChartOptions",
... | Null-safe setter for the renderTo configuration.
@param options the Options object to set the renderTo of
@param renderTo the render target | [
"Null",
"-",
"safe",
"setter",
"for",
"the",
"renderTo",
"configuration",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L56-L61 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.needsFunnelJs | public static boolean needsFunnelJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.FUNNEL ||
options.getChart().getType() == SeriesType.PYRAMID);
} | java | public static boolean needsFunnelJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.FUNNEL ||
options.getChart().getType() == SeriesType.PYRAMID);
} | [
"public",
"static",
"boolean",
"needsFunnelJs",
"(",
"final",
"Options",
"options",
")",
"{",
"return",
"options",
".",
"getChart",
"(",
")",
"!=",
"null",
"&&",
"(",
"options",
".",
"getChart",
"(",
")",
".",
"getType",
"(",
")",
"==",
"SeriesType",
"."... | Checks if the specified Options object needs the javascript file
"funnel.js" to work properly. This method can be called by GUI
components to determine whether the javascript file has to be included in
the page or not.
@param options the {@link Options} object to analyze
@return true, if "funnel.js" is needed to rende... | [
"Checks",
"if",
"the",
"specified",
"Options",
"object",
"needs",
"the",
"javascript",
"file",
"funnel",
".",
"js",
"to",
"work",
"properly",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"GUI",
"components",
"to",
"determine",
"whether",
"the",
"javas... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L102-L107 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.needsHeatmapJs | public static boolean needsHeatmapJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.HEATMAP);
} | java | public static boolean needsHeatmapJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.HEATMAP);
} | [
"public",
"static",
"boolean",
"needsHeatmapJs",
"(",
"final",
"Options",
"options",
")",
"{",
"return",
"options",
".",
"getChart",
"(",
")",
"!=",
"null",
"&&",
"(",
"options",
".",
"getChart",
"(",
")",
".",
"getType",
"(",
")",
"==",
"SeriesType",
".... | Checks if the specified Options object needs the javascript file
"heatmap.js" to work properly. This method can be called by GUI
components to determine whether the javascript file has to be included in
the page or not.
@param options the {@link Options} object to analyze
@return true, if "funnel.js" is needed to rend... | [
"Checks",
"if",
"the",
"specified",
"Options",
"object",
"needs",
"the",
"javascript",
"file",
"heatmap",
".",
"js",
"to",
"work",
"properly",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"GUI",
"components",
"to",
"determine",
"whether",
"the",
"java... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L119-L123 | train |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.needsExportingJs | public static boolean needsExportingJs(final Options options) {
// when no ExportingOptions are set, they are enabled by default, hence
// return true when they are null
return options.getExporting() == null
|| (options.getExporting().getEnabled() != null && options.getExporting(... | java | public static boolean needsExportingJs(final Options options) {
// when no ExportingOptions are set, they are enabled by default, hence
// return true when they are null
return options.getExporting() == null
|| (options.getExporting().getEnabled() != null && options.getExporting(... | [
"public",
"static",
"boolean",
"needsExportingJs",
"(",
"final",
"Options",
"options",
")",
"{",
"// when no ExportingOptions are set, they are enabled by default, hence",
"// return true when they are null",
"return",
"options",
".",
"getExporting",
"(",
")",
"==",
"null",
"... | Checks if the specified Options object needs the javascript file
"exporting.js" to work properly. This method can be called by GUI
components to determine whether the javascript file has to be included in
the page or not.
@param options the {@link Options} object to analyze
@return true, if "exporting.js" is needed to... | [
"Checks",
"if",
"the",
"specified",
"Options",
"object",
"needs",
"the",
"javascript",
"file",
"exporting",
".",
"js",
"to",
"work",
"properly",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"GUI",
"components",
"to",
"determine",
"whether",
"the",
"ja... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L135-L140 | train |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket8/src/main/java/de/adesso/wickedcharts/showcase/HomepageChartJs.java | HomepageChartJs.addCharts | private void addCharts(PageParameters parameters){
List<Chart> charts = getChartFromParams(parameters);
//If we have more than one chart - use SmallComponents
if(charts.size() > 1){
List<SmallChartComponent> components = new ArrayList<>();
for(Chart i : charts){
... | java | private void addCharts(PageParameters parameters){
List<Chart> charts = getChartFromParams(parameters);
//If we have more than one chart - use SmallComponents
if(charts.size() > 1){
List<SmallChartComponent> components = new ArrayList<>();
for(Chart i : charts){
... | [
"private",
"void",
"addCharts",
"(",
"PageParameters",
"parameters",
")",
"{",
"List",
"<",
"Chart",
">",
"charts",
"=",
"getChartFromParams",
"(",
"parameters",
")",
";",
"//If we have more than one chart - use SmallComponents",
"if",
"(",
"charts",
".",
"size",
"(... | Gets the charts and the code containers from the page parameters,
constructs Wicket componenets from them and
adds them to a Wicket ListView.
@param parameters the page parameters from the page URI | [
"Gets",
"the",
"charts",
"and",
"the",
"code",
"containers",
"from",
"the",
"page",
"parameters",
"constructs",
"Wicket",
"componenets",
"from",
"them",
"and",
"adds",
"them",
"to",
"a",
"Wicket",
"ListView",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket8/src/main/java/de/adesso/wickedcharts/showcase/HomepageChartJs.java#L67-L106 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.compareDepth | @SuppressWarnings("unchecked")
private Zipper<K, V> compareDepth(Tree<K, V> left, Tree<K, V> right) {
return unzipBoth(left, right, (List<Tree<K, V>>) Collections.EMPTY_LIST, (List<Tree<K, V>>) Collections.EMPTY_LIST, 0);
} | java | @SuppressWarnings("unchecked")
private Zipper<K, V> compareDepth(Tree<K, V> left, Tree<K, V> right) {
return unzipBoth(left, right, (List<Tree<K, V>>) Collections.EMPTY_LIST, (List<Tree<K, V>>) Collections.EMPTY_LIST, 0);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Zipper",
"<",
"K",
",",
"V",
">",
"compareDepth",
"(",
"Tree",
"<",
"K",
",",
"V",
">",
"left",
",",
"Tree",
"<",
"K",
",",
"V",
">",
"right",
")",
"{",
"return",
"unzipBoth",
"(",
"le... | If the trees were balanced, returns an empty zipper | [
"If",
"the",
"trees",
"were",
"balanced",
"returns",
"an",
"empty",
"zipper"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L466-L469 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.unzip | private List<Tree<K, V>> unzip(List<Tree<K, V>> zipper, boolean leftMost) {
Tree<K, V> next = leftMost ? zipper.get(0).getLeft() : zipper.get(0).getRight();
if (next == null)
return zipper;
return unzip(cons(next, zipper), leftMost);
} | java | private List<Tree<K, V>> unzip(List<Tree<K, V>> zipper, boolean leftMost) {
Tree<K, V> next = leftMost ? zipper.get(0).getLeft() : zipper.get(0).getRight();
if (next == null)
return zipper;
return unzip(cons(next, zipper), leftMost);
} | [
"private",
"List",
"<",
"Tree",
"<",
"K",
",",
"V",
">",
">",
"unzip",
"(",
"List",
"<",
"Tree",
"<",
"K",
",",
"V",
">",
">",
"zipper",
",",
"boolean",
"leftMost",
")",
"{",
"Tree",
"<",
"K",
",",
"V",
">",
"next",
"=",
"leftMost",
"?",
"zip... | Once a side is found to be deeper, unzip it to the bottom | [
"Once",
"a",
"side",
"is",
"found",
"to",
"be",
"deeper",
"unzip",
"it",
"to",
"the",
"bottom"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L472-L478 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.unzipBoth | @SuppressWarnings("unchecked")
private Zipper<K, V> unzipBoth(Tree<K, V> left, Tree<K, V> right, List<Tree<K, V>> leftZipper, List<Tree<K, V>> rightZipper, int smallerDepth) {
if (isBlackTree(left) && isBlackTree(right)) {
return unzipBoth(left.getRight(), right.getLeft(), cons(left, leftZipper)... | java | @SuppressWarnings("unchecked")
private Zipper<K, V> unzipBoth(Tree<K, V> left, Tree<K, V> right, List<Tree<K, V>> leftZipper, List<Tree<K, V>> rightZipper, int smallerDepth) {
if (isBlackTree(left) && isBlackTree(right)) {
return unzipBoth(left.getRight(), right.getLeft(), cons(left, leftZipper)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Zipper",
"<",
"K",
",",
"V",
">",
"unzipBoth",
"(",
"Tree",
"<",
"K",
",",
"V",
">",
"left",
",",
"Tree",
"<",
"K",
",",
"V",
">",
"right",
",",
"List",
"<",
"Tree",
"<",
"K",
",",
... | found to be deeper, or the bottom is reached | [
"found",
"to",
"be",
"deeper",
"or",
"the",
"bottom",
"is",
"reached"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L490-L509 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | Vector.get | @Override
public E get(int index) {
int idx = checkRangeConvert(index);
return pointer.getElem(idx, idx ^ focus);
} | java | @Override
public E get(int index) {
int idx = checkRangeConvert(index);
return pointer.getElem(idx, idx ^ focus);
} | [
"@",
"Override",
"public",
"E",
"get",
"(",
"int",
"index",
")",
"{",
"int",
"idx",
"=",
"checkRangeConvert",
"(",
"index",
")",
";",
"return",
"pointer",
".",
"getElem",
"(",
"idx",
",",
"idx",
"^",
"focus",
")",
";",
"}"
] | with local variables exclusively. But we're not quite there yet ... | [
"with",
"local",
"variables",
"exclusively",
".",
"But",
"we",
"re",
"not",
"quite",
"there",
"yet",
"..."
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L109-L113 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | Vector.cleanLeftEdge | private void cleanLeftEdge(int cutIndex) {
if (cutIndex < (1 << 5)) {
zeroLeft(pointer.display0, cutIndex);
} else if (cutIndex < (1 << 10)) {
zeroLeft(pointer.display0, cutIndex & 0x1f);
pointer.display1 = copyRight(pointer.display1, (cutIndex >>> 5));
} else... | java | private void cleanLeftEdge(int cutIndex) {
if (cutIndex < (1 << 5)) {
zeroLeft(pointer.display0, cutIndex);
} else if (cutIndex < (1 << 10)) {
zeroLeft(pointer.display0, cutIndex & 0x1f);
pointer.display1 = copyRight(pointer.display1, (cutIndex >>> 5));
} else... | [
"private",
"void",
"cleanLeftEdge",
"(",
"int",
"cutIndex",
")",
"{",
"if",
"(",
"cutIndex",
"<",
"(",
"1",
"<<",
"5",
")",
")",
"{",
"zeroLeft",
"(",
"pointer",
".",
"display0",
",",
"cutIndex",
")",
";",
"}",
"else",
"if",
"(",
"cutIndex",
"<",
"... | requires structure is at index cutIndex and writable at level 0 | [
"requires",
"structure",
"is",
"at",
"index",
"cutIndex",
"and",
"writable",
"at",
"level",
"0"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L447-L478 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.getElem | @SuppressWarnings("unchecked")
public E getElem(int index, int xor) {
if (xor < (1 << 5)) { // level = 0
return (E) display0[index & 31];
} else if (xor < (1 << 10)) { // level = 1
return (E) ((Object[]) display1[(index >> 5) & 31])[index & 31];
} else if (xor < (1 <<... | java | @SuppressWarnings("unchecked")
public E getElem(int index, int xor) {
if (xor < (1 << 5)) { // level = 0
return (E) display0[index & 31];
} else if (xor < (1 << 10)) { // level = 1
return (E) ((Object[]) display1[(index >> 5) & 31])[index & 31];
} else if (xor < (1 <<... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"E",
"getElem",
"(",
"int",
"index",
",",
"int",
"xor",
")",
"{",
"if",
"(",
"xor",
"<",
"(",
"1",
"<<",
"5",
")",
")",
"{",
"// level = 0",
"return",
"(",
"E",
")",
"display0",
"[",
"in... | requires structure is at pos oldIndex = xor ^ index | [
"requires",
"structure",
"is",
"at",
"pos",
"oldIndex",
"=",
"xor",
"^",
"index"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L671-L688 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.stabilize | public void stabilize(int index) {
switch (depth - 1) {
case 5:
display5 = copyOf(display5);
display4 = copyOf(display4);
display3 = copyOf(display3);
display2 = copyOf(display2);
display1 = copyOf(display1);
... | java | public void stabilize(int index) {
switch (depth - 1) {
case 5:
display5 = copyOf(display5);
display4 = copyOf(display4);
display3 = copyOf(display3);
display2 = copyOf(display2);
display1 = copyOf(display1);
... | [
"public",
"void",
"stabilize",
"(",
"int",
"index",
")",
"{",
"switch",
"(",
"depth",
"-",
"1",
")",
"{",
"case",
"5",
":",
"display5",
"=",
"copyOf",
"(",
"display5",
")",
";",
"display4",
"=",
"copyOf",
"(",
"display4",
")",
";",
"display3",
"=",
... | ensures structure is clean and at pos index and writable at all levels except 0 | [
"ensures",
"structure",
"is",
"clean",
"and",
"at",
"pos",
"index",
"and",
"writable",
"at",
"all",
"levels",
"except",
"0"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L834-L879 | train |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.copyRange | public Object[] copyRange(Object[] array, int oldLeft, int newLeft) {
Object[] elems = new Object[32];
System.arraycopy(array, oldLeft, elems, newLeft, 32 - Math.max(newLeft, oldLeft));
return elems;
} | java | public Object[] copyRange(Object[] array, int oldLeft, int newLeft) {
Object[] elems = new Object[32];
System.arraycopy(array, oldLeft, elems, newLeft, 32 - Math.max(newLeft, oldLeft));
return elems;
} | [
"public",
"Object",
"[",
"]",
"copyRange",
"(",
"Object",
"[",
"]",
"array",
",",
"int",
"oldLeft",
",",
"int",
"newLeft",
")",
"{",
"Object",
"[",
"]",
"elems",
"=",
"new",
"Object",
"[",
"32",
"]",
";",
"System",
".",
"arraycopy",
"(",
"array",
"... | USED IN DROP | [
"USED",
"IN",
"DROP"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L987-L991 | train |
f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.updateProgressButton | private void updateProgressButton(ProgressButton progressButton, SeekBar progressSeekBar) {
progressButton.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(progressButton);
} | java | private void updateProgressButton(ProgressButton progressButton, SeekBar progressSeekBar) {
progressButton.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(progressButton);
} | [
"private",
"void",
"updateProgressButton",
"(",
"ProgressButton",
"progressButton",
",",
"SeekBar",
"progressSeekBar",
")",
"{",
"progressButton",
".",
"setProgress",
"(",
"progressSeekBar",
".",
"getProgress",
"(",
")",
")",
";",
"updatePinProgressContentDescription",
... | Helper method to update the progressButton's progress and it's
content description. | [
"Helper",
"method",
"to",
"update",
"the",
"progressButton",
"s",
"progress",
"and",
"it",
"s",
"content",
"description",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L149-L152 | train |
f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.updatePinProgressContentDescription | private void updatePinProgressContentDescription(ProgressButton button) {
int progress = button.getProgress();
if (progress <= 0) {
button.setContentDescription(getString(
button.isChecked() ? R.string.content_desc_pinned_not_downloaded
: R.string.content_desc_unpinned_not_download... | java | private void updatePinProgressContentDescription(ProgressButton button) {
int progress = button.getProgress();
if (progress <= 0) {
button.setContentDescription(getString(
button.isChecked() ? R.string.content_desc_pinned_not_downloaded
: R.string.content_desc_unpinned_not_download... | [
"private",
"void",
"updatePinProgressContentDescription",
"(",
"ProgressButton",
"button",
")",
"{",
"int",
"progress",
"=",
"button",
".",
"getProgress",
"(",
")",
";",
"if",
"(",
"progress",
"<=",
"0",
")",
"{",
"button",
".",
"setContentDescription",
"(",
"... | Helper method to update the progressButton's content description. | [
"Helper",
"method",
"to",
"update",
"the",
"progressButton",
"s",
"content",
"description",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L157-L172 | train |
f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.addProgressButton | private ProgressButton addProgressButton(LinearLayout container) {
final LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
final ProgressButton progressButton = new ProgressButton(this);
progressButton.setLayoutParams(layoutParam... | java | private ProgressButton addProgressButton(LinearLayout container) {
final LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
final ProgressButton progressButton = new ProgressButton(this);
progressButton.setLayoutParams(layoutParam... | [
"private",
"ProgressButton",
"addProgressButton",
"(",
"LinearLayout",
"container",
")",
"{",
"final",
"LinearLayout",
".",
"LayoutParams",
"layoutParams",
"=",
"new",
"LinearLayout",
".",
"LayoutParams",
"(",
"0",
",",
"LinearLayout",
".",
"LayoutParams",
".",
"WRA... | Helper function that creates a new progress button, adds it to the given layout.
Returns a reference to the progress button for customization. | [
"Helper",
"function",
"that",
"creates",
"a",
"new",
"progress",
"button",
"adds",
"it",
"to",
"the",
"given",
"layout",
".",
"Returns",
"a",
"reference",
"to",
"the",
"progress",
"button",
"for",
"customization",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L178-L185 | train |
f2prateek/progressbutton | progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java | ProgressButton.setMax | public void setMax(int max) {
if (max <= 0 || max < mProgress) {
throw new IllegalArgumentException(
String.format("Max (%d) must be > 0 and >= %d", max, mProgress));
}
mMax = max;
invalidate();
} | java | public void setMax(int max) {
if (max <= 0 || max < mProgress) {
throw new IllegalArgumentException(
String.format("Max (%d) must be > 0 and >= %d", max, mProgress));
}
mMax = max;
invalidate();
} | [
"public",
"void",
"setMax",
"(",
"int",
"max",
")",
"{",
"if",
"(",
"max",
"<=",
"0",
"||",
"max",
"<",
"mProgress",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Max (%d) must be > 0 and >= %d\"",
",",
"max",
... | Sets the maximum progress value. Defaults to 100. | [
"Sets",
"the",
"maximum",
"progress",
"value",
".",
"Defaults",
"to",
"100",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java#L191-L198 | train |
f2prateek/progressbutton | progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java | ProgressButton.setProgressAndMax | public void setProgressAndMax(int progress, int max) {
if (progress > max || progress < 0) {
throw new IllegalArgumentException(
String.format("Progress (%d) must be between %d and %d", progress, 0, max));
} else if (max <= 0) {
throw new IllegalArgumentException(String.format("Max (%d) mu... | java | public void setProgressAndMax(int progress, int max) {
if (progress > max || progress < 0) {
throw new IllegalArgumentException(
String.format("Progress (%d) must be between %d and %d", progress, 0, max));
} else if (max <= 0) {
throw new IllegalArgumentException(String.format("Max (%d) mu... | [
"public",
"void",
"setProgressAndMax",
"(",
"int",
"progress",
",",
"int",
"max",
")",
"{",
"if",
"(",
"progress",
">",
"max",
"||",
"progress",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Progress ... | Sets the current progress and maximum progress value, both of which
must be valid values.
@see #setMax(int)
@see #setProgress(int) | [
"Sets",
"the",
"current",
"progress",
"and",
"maximum",
"progress",
"value",
"both",
"of",
"which",
"must",
"be",
"valid",
"values",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java#L226-L237 | train |
simplifycom/ink-android | ink/src/main/java/com/simplify/ink/InkView.java | InkView.setMaxStrokeWidth | public void setMaxStrokeWidth(float width) {
maxStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, getResources().getDisplayMetrics());
} | java | public void setMaxStrokeWidth(float width) {
maxStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, getResources().getDisplayMetrics());
} | [
"public",
"void",
"setMaxStrokeWidth",
"(",
"float",
"width",
")",
"{",
"maxStrokeWidth",
"=",
"TypedValue",
".",
"applyDimension",
"(",
"TypedValue",
".",
"COMPLEX_UNIT_DIP",
",",
"width",
",",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
")",
... | Sets the maximum stroke width
@param width The width (in dp) | [
"Sets",
"the",
"maximum",
"stroke",
"width"
] | 1a365e656b496554e7ee2e735bb775367f5eac0b | https://github.com/simplifycom/ink-android/blob/1a365e656b496554e7ee2e735bb775367f5eac0b/ink/src/main/java/com/simplify/ink/InkView.java#L343-L345 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.