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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ImmutableUtility.java | ImmutableUtility.generateImmutableCollectionIfPossible | public static void generateImmutableCollectionIfPossible(ModelClass<?> entity, Builder methodBuilder, String name,
TypeName typeName) {
if (TypeUtility.isList(typeName)
&& ((ParameterizedTypeName) typeName).rawType.equals(ClassName.get(List.class))) {
methodBuilder.addCode("($L==null ? null : $T.unmodifiabl... | java | public static void generateImmutableCollectionIfPossible(ModelClass<?> entity, Builder methodBuilder, String name,
TypeName typeName) {
if (TypeUtility.isList(typeName)
&& ((ParameterizedTypeName) typeName).rawType.equals(ClassName.get(List.class))) {
methodBuilder.addCode("($L==null ? null : $T.unmodifiabl... | [
"public",
"static",
"void",
"generateImmutableCollectionIfPossible",
"(",
"ModelClass",
"<",
"?",
">",
"entity",
",",
"Builder",
"methodBuilder",
",",
"String",
"name",
",",
"TypeName",
"typeName",
")",
"{",
"if",
"(",
"TypeUtility",
".",
"isList",
"(",
"typeNam... | used for example for dao select result
@param entity
@param methodBuilder
@param name
@param typeName | [
"used",
"for",
"example",
"for",
"dao",
"select",
"result"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ImmutableUtility.java#L196-L216 | train |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java | PagedList.get | @Override
@Nullable
public T get(int index) {
T item = mStorage.get(index);
if (item != null) {
mLastItem = item;
}
return item;
} | java | @Override
@Nullable
public T get(int index) {
T item = mStorage.get(index);
if (item != null) {
mLastItem = item;
}
return item;
} | [
"@",
"Override",
"@",
"Nullable",
"public",
"T",
"get",
"(",
"int",
"index",
")",
"{",
"T",
"item",
"=",
"mStorage",
".",
"get",
"(",
"index",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
"{",
"mLastItem",
"=",
"item",
";",
"}",
"return",
"ite... | Get the item in the list of loaded items at the provided index.
@param index Index in the loaded item list. Must be >= 0, and < {@link #size()}
@return The item at the passed index, or null if a null placeholder is at the specified
position.
@see #size() | [
"Get",
"the",
"item",
"in",
"the",
"list",
"of",
"loaded",
"items",
"at",
"the",
"provided",
"index",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java#L379-L387 | train |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java | PagedList.loadAround | public void loadAround(int index) {
mLastLoad = index + getPositionOffset();
loadAroundInternal(index);
mLowestIndexAccessed = Math.min(mLowestIndexAccessed, index);
mHighestIndexAccessed = Math.max(mHighestIndexAccessed, index);
/*
* mLowestIndexAccessed / mHighestInd... | java | public void loadAround(int index) {
mLastLoad = index + getPositionOffset();
loadAroundInternal(index);
mLowestIndexAccessed = Math.min(mLowestIndexAccessed, index);
mHighestIndexAccessed = Math.max(mHighestIndexAccessed, index);
/*
* mLowestIndexAccessed / mHighestInd... | [
"public",
"void",
"loadAround",
"(",
"int",
"index",
")",
"{",
"mLastLoad",
"=",
"index",
"+",
"getPositionOffset",
"(",
")",
";",
"loadAroundInternal",
"(",
"index",
")",
";",
"mLowestIndexAccessed",
"=",
"Math",
".",
"min",
"(",
"mLowestIndexAccessed",
",",
... | Load adjacent items to passed index.
@param index Index at which to load. | [
"Load",
"adjacent",
"items",
"to",
"passed",
"index",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java#L394-L410 | train |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java | PagedList.deferBoundaryCallbacks | void deferBoundaryCallbacks(final boolean deferEmpty,
final boolean deferBegin, final boolean deferEnd) {
if (mBoundaryCallback == null) {
throw new IllegalStateException("Can't defer BoundaryCallback, no instance");
}
/*
* If lowest/highest haven't been initial... | java | void deferBoundaryCallbacks(final boolean deferEmpty,
final boolean deferBegin, final boolean deferEnd) {
if (mBoundaryCallback == null) {
throw new IllegalStateException("Can't defer BoundaryCallback, no instance");
}
/*
* If lowest/highest haven't been initial... | [
"void",
"deferBoundaryCallbacks",
"(",
"final",
"boolean",
"deferEmpty",
",",
"final",
"boolean",
"deferBegin",
",",
"final",
"boolean",
"deferEnd",
")",
"{",
"if",
"(",
"mBoundaryCallback",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"... | Safe to access main thread only state - no other thread has reference during construction | [
"Safe",
"to",
"access",
"main",
"thread",
"only",
"state",
"-",
"no",
"other",
"thread",
"has",
"reference",
"during",
"construction"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java#L414-L458 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java | SQLiteDaoDefinition.resolveTypeVariable | void resolveTypeVariable(SQLiteModelMethod value) {
// before proceed, we need to resolve typeVariables
for (Pair<String, TypeName> item : value.getParameters()) {
item.value1 = typeVariableResolver.resolve(item.value1);
}
value.setReturnClass(typeVariableResolver.resolve(value.getReturnClass()));
} | java | void resolveTypeVariable(SQLiteModelMethod value) {
// before proceed, we need to resolve typeVariables
for (Pair<String, TypeName> item : value.getParameters()) {
item.value1 = typeVariableResolver.resolve(item.value1);
}
value.setReturnClass(typeVariableResolver.resolve(value.getReturnClass()));
} | [
"void",
"resolveTypeVariable",
"(",
"SQLiteModelMethod",
"value",
")",
"{",
"// before proceed, we need to resolve typeVariables",
"for",
"(",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
":",
"value",
".",
"getParameters",
"(",
")",
")",
"{",
"item",
".",... | Convert type variable in correct type. This must be done before work on
SQLMethod
@param value
the value | [
"Convert",
"type",
"variable",
"in",
"correct",
"type",
".",
"This",
"must",
"be",
"done",
"before",
"work",
"on",
"SQLMethod"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java#L84-L92 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java | SQLiteDaoDefinition.buildPreparedStatementName | String buildPreparedStatementName(String methodName) {
String name = methodName + "PreparedStatement" + preparedStatementNames.size();
preparedStatementNames.add(name);
return name;
} | java | String buildPreparedStatementName(String methodName) {
String name = methodName + "PreparedStatement" + preparedStatementNames.size();
preparedStatementNames.add(name);
return name;
} | [
"String",
"buildPreparedStatementName",
"(",
"String",
"methodName",
")",
"{",
"String",
"name",
"=",
"methodName",
"+",
"\"PreparedStatement\"",
"+",
"preparedStatementNames",
".",
"size",
"(",
")",
";",
"preparedStatementNames",
".",
"add",
"(",
"name",
")",
";"... | Build and register prepared statement name.
@param methodName
the method name
@return the string | [
"Build",
"and",
"register",
"prepared",
"statement",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java#L258-L263 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java | SQLiteDaoDefinition.generateJava2ContentSerializer | public String generateJava2ContentSerializer(TypeName paramTypeName) {
if (!managedParams.containsKey(paramTypeName)) {
managedParams.put(paramTypeName, "" + (managedParams.size() + 1));
}
return PARAM_SERIALIZER_PREFIX + managedParams.get(paramTypeName);
} | java | public String generateJava2ContentSerializer(TypeName paramTypeName) {
if (!managedParams.containsKey(paramTypeName)) {
managedParams.put(paramTypeName, "" + (managedParams.size() + 1));
}
return PARAM_SERIALIZER_PREFIX + managedParams.get(paramTypeName);
} | [
"public",
"String",
"generateJava2ContentSerializer",
"(",
"TypeName",
"paramTypeName",
")",
"{",
"if",
"(",
"!",
"managedParams",
".",
"containsKey",
"(",
"paramTypeName",
")",
")",
"{",
"managedParams",
".",
"put",
"(",
"paramTypeName",
",",
"\"\"",
"+",
"(",
... | Generate java 2 content serializer.
@param paramTypeName
the param type name
@return the string | [
"Generate",
"java",
"2",
"content",
"serializer",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java#L284-L290 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java | SQLiteDaoDefinition.generateJava2ContentParser | public String generateJava2ContentParser(TypeName paramTypeName) {
if (!managedParams.containsKey(paramTypeName)) {
managedParams.put(paramTypeName, "" + (managedParams.size() + 1));
}
return PARAM_PARSER_PREFIX + managedParams.get(paramTypeName);
} | java | public String generateJava2ContentParser(TypeName paramTypeName) {
if (!managedParams.containsKey(paramTypeName)) {
managedParams.put(paramTypeName, "" + (managedParams.size() + 1));
}
return PARAM_PARSER_PREFIX + managedParams.get(paramTypeName);
} | [
"public",
"String",
"generateJava2ContentParser",
"(",
"TypeName",
"paramTypeName",
")",
"{",
"if",
"(",
"!",
"managedParams",
".",
"containsKey",
"(",
"paramTypeName",
")",
")",
"{",
"managedParams",
".",
"put",
"(",
"paramTypeName",
",",
"\"\"",
"+",
"(",
"m... | Generate java 2 content parser.
@param paramTypeName
the param type name
@return the string | [
"Generate",
"java",
"2",
"content",
"parser",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java#L299-L305 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java | SQLiteDaoDefinition.hasSamePackageOfSchema | public boolean hasSamePackageOfSchema() {
String packageName = getPackageName();
String schemaPackageName = getParent().getPackageName();
return packageName.equals(schemaPackageName);
} | java | public boolean hasSamePackageOfSchema() {
String packageName = getPackageName();
String schemaPackageName = getParent().getPackageName();
return packageName.equals(schemaPackageName);
} | [
"public",
"boolean",
"hasSamePackageOfSchema",
"(",
")",
"{",
"String",
"packageName",
"=",
"getPackageName",
"(",
")",
";",
"String",
"schemaPackageName",
"=",
"getParent",
"(",
")",
".",
"getPackageName",
"(",
")",
";",
"return",
"packageName",
".",
"equals",
... | Returns true if dao and schema stay in same package
@return | [
"Returns",
"true",
"if",
"dao",
"and",
"schema",
"stay",
"in",
"same",
"package"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/model/SQLiteDaoDefinition.java#L371-L376 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/GenericSQLHelper.java | GenericSQLHelper.generateSubjectNext | public static void generateSubjectNext(SQLiteEntity entity, MethodSpec.Builder methodBuilder,
SubjectType subjectType, String value) {
String subInsertType = "";
if (subjectType == SubjectType.INSERT) {
if (entity.getPrimaryKey().isType(String.class)) {
subInsertType = "WithUid";
} else {
subInsert... | java | public static void generateSubjectNext(SQLiteEntity entity, MethodSpec.Builder methodBuilder,
SubjectType subjectType, String value) {
String subInsertType = "";
if (subjectType == SubjectType.INSERT) {
if (entity.getPrimaryKey().isType(String.class)) {
subInsertType = "WithUid";
} else {
subInsert... | [
"public",
"static",
"void",
"generateSubjectNext",
"(",
"SQLiteEntity",
"entity",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SubjectType",
"subjectType",
",",
"String",
"value",
")",
"{",
"String",
"subInsertType",
"=",
"\"\"",
";",
"if",
"(",
"su... | Generate subject next.
@param entity
@param methodBuilder
the method builder
@param subjectType
the subject type
@param value | [
"Generate",
"subject",
"next",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/GenericSQLHelper.java#L91-L107 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readBoolean | public static Boolean readBoolean(String value, Boolean defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Boolean.valueOf(value);
} | java | public static Boolean readBoolean(String value, Boolean defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Boolean.valueOf(value);
} | [
"public",
"static",
"Boolean",
"readBoolean",
"(",
"String",
"value",
",",
"Boolean",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Boolean",
".",
"valueOf",
"(",
... | Read boolean.
@param value the value
@param defaultValue the default value
@return the boolean | [
"Read",
"boolean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L31-L35 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readByte | public static Byte readByte(String value, Byte defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Byte.valueOf(value);
} | java | public static Byte readByte(String value, Byte defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Byte.valueOf(value);
} | [
"public",
"static",
"Byte",
"readByte",
"(",
"String",
"value",
",",
"Byte",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Byte",
".",
"valueOf",
"(",
"value",
"... | Read byte.
@param value the value
@param defaultValue the default value
@return the byte | [
"Read",
"byte",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L56-L60 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readCharacter | public static Character readCharacter(String value, Character defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Character.valueOf((char)Integer.parseInt(value));
} | java | public static Character readCharacter(String value, Character defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Character.valueOf((char)Integer.parseInt(value));
} | [
"public",
"static",
"Character",
"readCharacter",
"(",
"String",
"value",
",",
"Character",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Character",
".",
"valueOf",
... | Read character.
@param value the value
@param defaultValue the default value
@return the character | [
"Read",
"character",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L80-L84 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readShort | public static Short readShort(String value, Short defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Short.valueOf(value);
} | java | public static Short readShort(String value, Short defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Short.valueOf(value);
} | [
"public",
"static",
"Short",
"readShort",
"(",
"String",
"value",
",",
"Short",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Short",
".",
"valueOf",
"(",
"value",... | Read short.
@param value the value
@param defaultValue the default value
@return the short | [
"Read",
"short",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L104-L108 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readInteger | public static Integer readInteger(String value, Integer defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Integer.valueOf(value);
} | java | public static Integer readInteger(String value, Integer defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Integer.valueOf(value);
} | [
"public",
"static",
"Integer",
"readInteger",
"(",
"String",
"value",
",",
"Integer",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Integer",
".",
"valueOf",
"(",
... | Read integer.
@param value the value
@param defaultValue the default value
@return the integer | [
"Read",
"integer",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L128-L132 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readLong | public static Long readLong(String value, Long defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Long.valueOf(value);
} | java | public static Long readLong(String value, Long defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Long.valueOf(value);
} | [
"public",
"static",
"Long",
"readLong",
"(",
"String",
"value",
",",
"Long",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Long",
".",
"valueOf",
"(",
"value",
"... | Read long.
@param value the value
@param defaultValue the default value
@return the long | [
"Read",
"long",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L152-L156 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readFloat | public static Float readFloat(String value, Float defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Float.valueOf(value);
} | java | public static Float readFloat(String value, Float defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Float.valueOf(value);
} | [
"public",
"static",
"Float",
"readFloat",
"(",
"String",
"value",
",",
"Float",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Float",
".",
"valueOf",
"(",
"value",... | Read float.
@param value the value
@param defaultValue the default value
@return the float | [
"Read",
"float",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L176-L180 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readDouble | public static Double readDouble(String value, Double defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Double.valueOf(value);
} | java | public static Double readDouble(String value, Double defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Double.valueOf(value);
} | [
"public",
"static",
"Double",
"readDouble",
"(",
"String",
"value",
",",
"Double",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Double",
".",
"valueOf",
"(",
"val... | Read double.
@param value the value
@param defaultValue the default value
@return the double | [
"Read",
"double",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L200-L204 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeBoolean | public static String writeBoolean(Boolean value) {
if (value==null) return null;
return Boolean.toString(value);
} | java | public static String writeBoolean(Boolean value) {
if (value==null) return null;
return Boolean.toString(value);
} | [
"public",
"static",
"String",
"writeBoolean",
"(",
"Boolean",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Boolean",
".",
"toString",
"(",
"value",
")",
";",
"}"
] | Write boolean.
@param value the value
@return the string | [
"Write",
"boolean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L223-L227 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeCharacter | public static String writeCharacter(Character value) {
if (value==null) return null;
return Integer.toString((int)value);
} | java | public static String writeCharacter(Character value) {
if (value==null) return null;
return Integer.toString((int)value);
} | [
"public",
"static",
"String",
"writeCharacter",
"(",
"Character",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Integer",
".",
"toString",
"(",
"(",
"int",
")",
"value",
")",
";",
"}"
] | Write character.
@param value the value
@return the string | [
"Write",
"character",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L247-L251 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeShort | public static String writeShort(Short value) {
if (value==null) return null;
return Short.toString(value);
} | java | public static String writeShort(Short value) {
if (value==null) return null;
return Short.toString(value);
} | [
"public",
"static",
"String",
"writeShort",
"(",
"Short",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Short",
".",
"toString",
"(",
"value",
")",
";",
"}"
] | Write short.
@param value the value
@return the string | [
"Write",
"short",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L259-L263 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeInteger | public static String writeInteger(Integer value) {
if (value==null) return null;
return Integer.toString(value);
} | java | public static String writeInteger(Integer value) {
if (value==null) return null;
return Integer.toString(value);
} | [
"public",
"static",
"String",
"writeInteger",
"(",
"Integer",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Integer",
".",
"toString",
"(",
"value",
")",
";",
"}"
] | Write integer.
@param value the value
@return the string | [
"Write",
"integer",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L271-L275 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeLong | public static String writeLong(Long value) {
if (value==null) return null;
return Long.toString(value);
} | java | public static String writeLong(Long value) {
if (value==null) return null;
return Long.toString(value);
} | [
"public",
"static",
"String",
"writeLong",
"(",
"Long",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Long",
".",
"toString",
"(",
"value",
")",
";",
"}"
] | Write long.
@param value the value
@return the string | [
"Write",
"long",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L283-L287 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeFloat | public static String writeFloat(Float value) {
if (value==null) return null;
return Float.toString(value);
} | java | public static String writeFloat(Float value) {
if (value==null) return null;
return Float.toString(value);
} | [
"public",
"static",
"String",
"writeFloat",
"(",
"Float",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Float",
".",
"toString",
"(",
"value",
")",
";",
"}"
] | Write float.
@param value the value
@return the string | [
"Write",
"float",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L295-L299 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.writeDouble | public static String writeDouble(Double value) {
if (value==null) return null;
return Double.toString(value);
} | java | public static String writeDouble(Double value) {
if (value==null) return null;
return Double.toString(value);
} | [
"public",
"static",
"String",
"writeDouble",
"(",
"Double",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"return",
"Double",
".",
"toString",
"(",
"value",
")",
";",
"}"
] | Write double.
@param value the value
@return the string | [
"Write",
"double",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L307-L311 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java | AbstractDataSource.buildTaskList | protected List<SQLiteUpdateTask> buildTaskList(int previousVersion, int currentVersion) {
List<SQLiteUpdateTask> result = new ArrayList<>();
for (Pair<Integer, ? extends SQLiteUpdateTask> item : this.options.updateTasks) {
if (item.value0 - 1 == previousVersion) {
result.add(item.value1);
previousVersio... | java | protected List<SQLiteUpdateTask> buildTaskList(int previousVersion, int currentVersion) {
List<SQLiteUpdateTask> result = new ArrayList<>();
for (Pair<Integer, ? extends SQLiteUpdateTask> item : this.options.updateTasks) {
if (item.value0 - 1 == previousVersion) {
result.add(item.value1);
previousVersio... | [
"protected",
"List",
"<",
"SQLiteUpdateTask",
">",
"buildTaskList",
"(",
"int",
"previousVersion",
",",
"int",
"currentVersion",
")",
"{",
"List",
"<",
"SQLiteUpdateTask",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Pair",
"<",
... | Builds the task list.
@param previousVersion
the previous version
@param currentVersion
the current version
@return the list | [
"Builds",
"the",
"task",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java#L402-L421 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java | AbstractDataSource.createHelper | protected void createHelper(DataSourceOptions options) {
if (KriptonLibrary.getContext() == null)
throw new KriptonRuntimeException("Kripton library is not properly initialized. Please use KriptonLibrary.init(context) somewhere at application startup");
if (options.inMemory) {
Logger.info("In-memory databa... | java | protected void createHelper(DataSourceOptions options) {
if (KriptonLibrary.getContext() == null)
throw new KriptonRuntimeException("Kripton library is not properly initialized. Please use KriptonLibrary.init(context) somewhere at application startup");
if (options.inMemory) {
Logger.info("In-memory databa... | [
"protected",
"void",
"createHelper",
"(",
"DataSourceOptions",
"options",
")",
"{",
"if",
"(",
"KriptonLibrary",
".",
"getContext",
"(",
")",
"==",
"null",
")",
"throw",
"new",
"KriptonRuntimeException",
"(",
"\"Kripton library is not properly initialized. Please use Krip... | Creates the helper.
@param options
the options | [
"Creates",
"the",
"helper",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java#L429-L463 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java | AbstractDataSource.onDowngrade | public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, false);
versionChanged = true;
}
} | java | public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, false);
versionChanged = true;
}
} | [
"public",
"void",
"onDowngrade",
"(",
"SQLiteDatabase",
"db",
",",
"int",
"oldVersion",
",",
"int",
"newVersion",
")",
"{",
"if",
"(",
"AbstractDataSource",
".",
"this",
".",
"options",
".",
"databaseLifecycleHandler",
"!=",
"null",
")",
"{",
"AbstractDataSource... | On downgrade.
@param db
the db
@param oldVersion
the old version
@param newVersion
the new version | [
"On",
"downgrade",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java#L537-L542 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java | AbstractDataSource.onUpgrade | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, true);
versionChanged = true;
}
} | java | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, true);
versionChanged = true;
}
} | [
"public",
"void",
"onUpgrade",
"(",
"SQLiteDatabase",
"db",
",",
"int",
"oldVersion",
",",
"int",
"newVersion",
")",
"{",
"if",
"(",
"AbstractDataSource",
".",
"this",
".",
"options",
".",
"databaseLifecycleHandler",
"!=",
"null",
")",
"{",
"AbstractDataSource",... | On upgrade.
@param db
the db
@param oldVersion
the old version
@param newVersion
the new version | [
"On",
"upgrade",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/AbstractDataSource.java#L554-L559 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrue | public static void assertTrue(boolean expression, String messageFormat, Object... args) {
if (!expression)
throw (new KriptonProcessorException(String.format(messageFormat, args)));
} | java | public static void assertTrue(boolean expression, String messageFormat, Object... args) {
if (!expression)
throw (new KriptonProcessorException(String.format(messageFormat, args)));
} | [
"public",
"static",
"void",
"assertTrue",
"(",
"boolean",
"expression",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"throw",
"(",
"new",
"KriptonProcessorException",
"(",
"String",
".",
"format",
... | Assertion which generate an exception if expression is not true.
@param expression
the expression
@param messageFormat
the message format
@param args
the args | [
"Assertion",
"which",
"generate",
"an",
"exception",
"if",
"expression",
"is",
"not",
"true",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L69-L73 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidMethodSignException | public static void assertTrueOrInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
if (!expression)
throw (new InvalidMethodSignException(method, String.format(messageFormat, args)));
} | java | public static void assertTrueOrInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
if (!expression)
throw (new InvalidMethodSignException(method, String.format(messageFormat, args)));
} | [
"public",
"static",
"void",
"assertTrueOrInvalidMethodSignException",
"(",
"boolean",
"expression",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"throw",
"(",
"new",
... | Assert true or invalid method sign exception.
@param expression
the expression
@param method
the method
@param messageFormat
the message format
@param args
the args | [
"Assert",
"true",
"or",
"invalid",
"method",
"sign",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L87-L91 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.failWithInvalidMethodSignException | public static void failWithInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
assertTrueOrInvalidMethodSignException(!expression, method, messageFormat, args);
} | java | public static void failWithInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
assertTrueOrInvalidMethodSignException(!expression, method, messageFormat, args);
} | [
"public",
"static",
"void",
"failWithInvalidMethodSignException",
"(",
"boolean",
"expression",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"assertTrueOrInvalidMethodSignException",
"(",
"!",
"expression",
... | if expression is true, it fails. It is the opposite of assert
@param expression
the expression
@param method
the method
@param messageFormat
the message format
@param args
the args | [
"if",
"expression",
"is",
"true",
"it",
"fails",
".",
"It",
"is",
"the",
"opposite",
"of",
"assert"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L131-L134 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.failIncompatibleAttributesInAnnotationException | public static void failIncompatibleAttributesInAnnotationException(String messageFormat, Object... args) {
throw (new IncompatibleAttributesInAnnotationException(String.format(messageFormat, args)));
} | java | public static void failIncompatibleAttributesInAnnotationException(String messageFormat, Object... args) {
throw (new IncompatibleAttributesInAnnotationException(String.format(messageFormat, args)));
} | [
"public",
"static",
"void",
"failIncompatibleAttributesInAnnotationException",
"(",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"throw",
"(",
"new",
"IncompatibleAttributesInAnnotationException",
"(",
"String",
".",
"format",
"(",
"messageFormat",
... | Fail incompatible attributes in annotation exception.
@param messageFormat
the message format
@param args
the args | [
"Fail",
"incompatible",
"attributes",
"in",
"annotation",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L156-L158 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.fail | public static void fail(boolean expression, String messageFormat, Object... args) {
assertTrue(!expression, messageFormat, args);
} | java | public static void fail(boolean expression, String messageFormat, Object... args) {
assertTrue(!expression, messageFormat, args);
} | [
"public",
"static",
"void",
"fail",
"(",
"boolean",
"expression",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"{",
"assertTrue",
"(",
"!",
"expression",
",",
"messageFormat",
",",
"args",
")",
";",
"}"
] | Fails if expression is true.
@param expression
the expression
@param messageFormat
the message format
@param args
the args | [
"Fails",
"if",
"expression",
"is",
"true",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L170-L172 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidKindForAnnotationException | public static void assertTrueOrInvalidKindForAnnotationException(boolean expression, Element element,
Class<? extends Annotation> annotationClazz) {
if (!expression) {
String msg = String.format("%s %s, only class can be annotated with @%s annotation", element.getKind(),
element, annotationClazz.getSimpleN... | java | public static void assertTrueOrInvalidKindForAnnotationException(boolean expression, Element element,
Class<? extends Annotation> annotationClazz) {
if (!expression) {
String msg = String.format("%s %s, only class can be annotated with @%s annotation", element.getKind(),
element, annotationClazz.getSimpleN... | [
"public",
"static",
"void",
"assertTrueOrInvalidKindForAnnotationException",
"(",
"boolean",
"expression",
",",
"Element",
"element",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClazz",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String... | Assert true or invalid kind for annotation exception.
@param expression
the expression
@param element
the element
@param annotationClazz
the annotation clazz | [
"Assert",
"true",
"or",
"invalid",
"kind",
"for",
"annotation",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L197-L204 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidTypeForAnnotationMethodParameterException | public static void assertTrueOrInvalidTypeForAnnotationMethodParameterException(boolean expression,
Element classElement, ExecutableElement methodElement, VariableElement parameterElement,
Class<? extends Annotation> annotationClazz) {
if (!expression) {
String msg = String.format("In method '%s.%s', paramet... | java | public static void assertTrueOrInvalidTypeForAnnotationMethodParameterException(boolean expression,
Element classElement, ExecutableElement methodElement, VariableElement parameterElement,
Class<? extends Annotation> annotationClazz) {
if (!expression) {
String msg = String.format("In method '%s.%s', paramet... | [
"public",
"static",
"void",
"assertTrueOrInvalidTypeForAnnotationMethodParameterException",
"(",
"boolean",
"expression",
",",
"Element",
"classElement",
",",
"ExecutableElement",
"methodElement",
",",
"VariableElement",
"parameterElement",
",",
"Class",
"<",
"?",
"extends",
... | In case a method's parameters is of a type incompatible with specific annotation.
@param expression
the expression
@param classElement
the class element
@param methodElement
the method element
@param parameterElement
the parameter element
@param annotationClazz
the annotation clazz | [
"In",
"case",
"a",
"method",
"s",
"parameters",
"is",
"of",
"a",
"type",
"incompatible",
"with",
"specific",
"annotation",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L220-L230 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrUnknownPropertyInJQLException | public static void assertTrueOrUnknownPropertyInJQLException(boolean expression, JQLContext method,
String columnName) {
if (!expression) {
throw (new UnknownPropertyInJQLException(method, columnName));
}
} | java | public static void assertTrueOrUnknownPropertyInJQLException(boolean expression, JQLContext method,
String columnName) {
if (!expression) {
throw (new UnknownPropertyInJQLException(method, columnName));
}
} | [
"public",
"static",
"void",
"assertTrueOrUnknownPropertyInJQLException",
"(",
"boolean",
"expression",
",",
"JQLContext",
"method",
",",
"String",
"columnName",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"(",
"new",
"UnknownPropertyInJQLException",
"... | Assert true or unknown property in JQL exception.
@param expression
the expression
@param method
the method
@param columnName
the column name | [
"Assert",
"true",
"or",
"unknown",
"property",
"in",
"JQL",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L257-L263 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrUnknownClassInJQLException | public static void assertTrueOrUnknownClassInJQLException(boolean expression, SQLiteModelMethod method,
String className) {
if (!expression) {
throw (new UnknownClassInJQLException(method, className));
}
} | java | public static void assertTrueOrUnknownClassInJQLException(boolean expression, SQLiteModelMethod method,
String className) {
if (!expression) {
throw (new UnknownClassInJQLException(method, className));
}
} | [
"public",
"static",
"void",
"assertTrueOrUnknownClassInJQLException",
"(",
"boolean",
"expression",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"className",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"(",
"new",
"UnknownClassInJQLException",
"... | Assert true or unknown class in JQL exception.
@param expression
the expression
@param method
the method
@param className
the class name | [
"Assert",
"true",
"or",
"unknown",
"class",
"in",
"JQL",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L275-L280 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrUnknownParamInJQLException | public static void assertTrueOrUnknownParamInJQLException(boolean expression, SQLiteModelMethod method,
String paramName) {
if (!expression) {
throw (new UnknownParamUsedInJQLException(method, paramName));
}
} | java | public static void assertTrueOrUnknownParamInJQLException(boolean expression, SQLiteModelMethod method,
String paramName) {
if (!expression) {
throw (new UnknownParamUsedInJQLException(method, paramName));
}
} | [
"public",
"static",
"void",
"assertTrueOrUnknownParamInJQLException",
"(",
"boolean",
"expression",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"(",
"new",
"UnknownParamUsedInJQLException",... | Assert true or unknown param in JQL exception.
@param expression
the expression
@param method
the method
@param paramName
the param name | [
"Assert",
"true",
"or",
"unknown",
"param",
"in",
"JQL",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L292-L297 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.failUnknownPropertyInJQLException | public static void failUnknownPropertyInJQLException(SQLiteModelMethod method,
Class<? extends Annotation> annotationClazz, AnnotationAttributeType attribute, String fieldName) {
throw (new UnknownPropertyInJQLException(method, annotationClazz, attribute, fieldName));
} | java | public static void failUnknownPropertyInJQLException(SQLiteModelMethod method,
Class<? extends Annotation> annotationClazz, AnnotationAttributeType attribute, String fieldName) {
throw (new UnknownPropertyInJQLException(method, annotationClazz, attribute, fieldName));
} | [
"public",
"static",
"void",
"failUnknownPropertyInJQLException",
"(",
"SQLiteModelMethod",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClazz",
",",
"AnnotationAttributeType",
"attribute",
",",
"String",
"fieldName",
")",
"{",
"throw",
"(... | Fail unknown property in JQL exception.
@param method
the method
@param annotationClazz
the annotation clazz
@param attribute
the attribute
@param fieldName
the field name | [
"Fail",
"unknown",
"property",
"in",
"JQL",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L311-L315 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidPropertyName | public static void assertTrueOrInvalidPropertyName(boolean expression, SQLProperty item1, SQLProperty item2) {
if (!expression) {
String msg = String.format("Properties '%s#%s' and '%s#%s' must have same column name",
item1.getParent().name, item1.name, item2.getParent().name, item2.name);
throw (new Inval... | java | public static void assertTrueOrInvalidPropertyName(boolean expression, SQLProperty item1, SQLProperty item2) {
if (!expression) {
String msg = String.format("Properties '%s#%s' and '%s#%s' must have same column name",
item1.getParent().name, item1.name, item2.getParent().name, item2.name);
throw (new Inval... | [
"public",
"static",
"void",
"assertTrueOrInvalidPropertyName",
"(",
"boolean",
"expression",
",",
"SQLProperty",
"item1",
",",
"SQLProperty",
"item2",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"Prop... | Assert true or invalid property name.
@param expression
the expression
@param item1
the item 1
@param item2
the item 2 | [
"Assert",
"true",
"or",
"invalid",
"property",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L327-L334 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.asserTrueOrForeignKeyNotFound | public static void asserTrueOrForeignKeyNotFound(boolean expression, SQLiteEntity currentEntity, ClassName entity) {
if (!expression) {
throw (new ForeignKeyNotFoundException(currentEntity, entity));
}
} | java | public static void asserTrueOrForeignKeyNotFound(boolean expression, SQLiteEntity currentEntity, ClassName entity) {
if (!expression) {
throw (new ForeignKeyNotFoundException(currentEntity, entity));
}
} | [
"public",
"static",
"void",
"asserTrueOrForeignKeyNotFound",
"(",
"boolean",
"expression",
",",
"SQLiteEntity",
"currentEntity",
",",
"ClassName",
"entity",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"(",
"new",
"ForeignKeyNotFoundException",
"(",
... | Asser true or foreign key not found.
@param expression
the expression
@param currentEntity
the current entity
@param entity
the entity | [
"Asser",
"true",
"or",
"foreign",
"key",
"not",
"found",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L347-L353 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.asserTrueOrMissedAnnotationOnClassException | public static void asserTrueOrMissedAnnotationOnClassException(boolean expression, TypeElement daoElement,
String entityName) {
if (!expression) {
String msg = String.format("Dao '%s' referes a bean '%s' without @%s or @%s annotation",
daoElement.getQualifiedName(), TypeUtility.className(entityName), BindT... | java | public static void asserTrueOrMissedAnnotationOnClassException(boolean expression, TypeElement daoElement,
String entityName) {
if (!expression) {
String msg = String.format("Dao '%s' referes a bean '%s' without @%s or @%s annotation",
daoElement.getQualifiedName(), TypeUtility.className(entityName), BindT... | [
"public",
"static",
"void",
"asserTrueOrMissedAnnotationOnClassException",
"(",
"boolean",
"expression",
",",
"TypeElement",
"daoElement",
",",
"String",
"entityName",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",... | Asser true or missed annotation on class exception.
@param expression
the expression
@param daoElement
the dao element
@param entityName
the entity name | [
"Asser",
"true",
"or",
"missed",
"annotation",
"on",
"class",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L366-L375 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.asserTrueOrUnspecifiedBeanException | public static void asserTrueOrUnspecifiedBeanException(boolean expression, SQLiteDatabaseSchema schema,
SQLiteEntity entity, String foreignClassName) {
if (!expression) {
String msg = String.format(
"In dao definition '%s' is referred a bean definition '%s' that is not defined in '%s' schema",
entity.... | java | public static void asserTrueOrUnspecifiedBeanException(boolean expression, SQLiteDatabaseSchema schema,
SQLiteEntity entity, String foreignClassName) {
if (!expression) {
String msg = String.format(
"In dao definition '%s' is referred a bean definition '%s' that is not defined in '%s' schema",
entity.... | [
"public",
"static",
"void",
"asserTrueOrUnspecifiedBeanException",
"(",
"boolean",
"expression",
",",
"SQLiteDatabaseSchema",
"schema",
",",
"SQLiteEntity",
"entity",
",",
"String",
"foreignClassName",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String",
"msg... | Asser true or unspecified bean exception.
@param expression
the expression
@param schema
the schema
@param entity
the entity
@param foreignClassName
the foreign class name | [
"Asser",
"true",
"or",
"unspecified",
"bean",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L389-L398 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOfInvalidDefinition | public static void assertTrueOfInvalidDefinition(boolean expression, ModelProperty property, String message) {
if (!expression) {
String msg = String.format("In class '%s', property '%s' has invalid definition: %s",
property.getParent().getElement().asType().toString(), property.getName(), message);
throw ... | java | public static void assertTrueOfInvalidDefinition(boolean expression, ModelProperty property, String message) {
if (!expression) {
String msg = String.format("In class '%s', property '%s' has invalid definition: %s",
property.getParent().getElement().asType().toString(), property.getName(), message);
throw ... | [
"public",
"static",
"void",
"assertTrueOfInvalidDefinition",
"(",
"boolean",
"expression",
",",
"ModelProperty",
"property",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"In c... | Assert true of invalid definition.
@param expression
the expression
@param property
the property
@param message
the message | [
"Assert",
"true",
"of",
"invalid",
"definition",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L410-L416 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidGlobalTypeApdaterException | public static void assertTrueOrInvalidGlobalTypeApdaterException(boolean expression,
SQLiteDatabaseSchema sqLiteDatabaseSchema, String typeAdapter, String typeAdapter2) {
if (!expression) {
String msg = String.format(
"In data source '%s', there are two or more global type adapter that cover type '%s': '%s... | java | public static void assertTrueOrInvalidGlobalTypeApdaterException(boolean expression,
SQLiteDatabaseSchema sqLiteDatabaseSchema, String typeAdapter, String typeAdapter2) {
if (!expression) {
String msg = String.format(
"In data source '%s', there are two or more global type adapter that cover type '%s': '%s... | [
"public",
"static",
"void",
"assertTrueOrInvalidGlobalTypeApdaterException",
"(",
"boolean",
"expression",
",",
"SQLiteDatabaseSchema",
"sqLiteDatabaseSchema",
",",
"String",
"typeAdapter",
",",
"String",
"typeAdapter2",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",... | Assert true or invalid global type apdater exception.
@param expression
the expression
@param sqLiteDatabaseSchema
the sq lite database schema
@param typeAdapter
the type adapter
@param typeAdapter2
the type adapter 2 | [
"Assert",
"true",
"or",
"invalid",
"global",
"type",
"apdater",
"exception",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L448-L457 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/map/BindMapVisitor.java | BindMapVisitor.visitList | @SuppressWarnings("unchecked")
static VisitorStatusType visitList(String name, List<Object> list, BindMapListener listener, VisitorStatusType status) {
int i = 0;
for (Object item : list) {
if (item == null || item instanceof String) {
visit(name + "." + i, (String) item, listener, status);
} else if (it... | java | @SuppressWarnings("unchecked")
static VisitorStatusType visitList(String name, List<Object> list, BindMapListener listener, VisitorStatusType status) {
int i = 0;
for (Object item : list) {
if (item == null || item instanceof String) {
visit(name + "." + i, (String) item, listener, status);
} else if (it... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"VisitorStatusType",
"visitList",
"(",
"String",
"name",
",",
"List",
"<",
"Object",
">",
"list",
",",
"BindMapListener",
"listener",
",",
"VisitorStatusType",
"status",
")",
"{",
"int",
"i",
"=",
"... | Visit list.
@param name the name
@param list the list
@param listener the listener
@param status the status
@return the visitor status type | [
"Visit",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/map/BindMapVisitor.java#L82-L100 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/CodeBuilderUtility.java | CodeBuilderUtility.extractUsedProperties | public static List<SQLProperty> extractUsedProperties(Builder methodBuilder, SQLiteModelMethod method, Class<? extends Annotation> annotationClazz) {
SQLiteEntity entity = method.getEntity();
List<SQLProperty> listPropertyInContentValue = new ArrayList<SQLProperty>();
Set<String> foundColumns = JQLChecker.getIns... | java | public static List<SQLProperty> extractUsedProperties(Builder methodBuilder, SQLiteModelMethod method, Class<? extends Annotation> annotationClazz) {
SQLiteEntity entity = method.getEntity();
List<SQLProperty> listPropertyInContentValue = new ArrayList<SQLProperty>();
Set<String> foundColumns = JQLChecker.getIns... | [
"public",
"static",
"List",
"<",
"SQLProperty",
">",
"extractUsedProperties",
"(",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClazz",
")",
"{",
"SQLiteEntity",
"entity",
"=",
"me... | Generate code necessary to put bean properties in content values map.
Return primary key
@param methodBuilder
used to code generation
@param method
the method
@param annotationClazz
the annotation clazz
@return primary key. | [
"Generate",
"code",
"necessary",
"to",
"put",
"bean",
"properties",
"in",
"content",
"values",
"map",
".",
"Return",
"primary",
"key"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/CodeBuilderUtility.java#L53-L71 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.analyzePathInternal | private <L extends UriBaseListener> void analyzePathInternal(final String input, L listener) {
pathSegmentIndex = -1;
walker.walk(listener, preparePath(input).value0);
} | java | private <L extends UriBaseListener> void analyzePathInternal(final String input, L listener) {
pathSegmentIndex = -1;
walker.walk(listener, preparePath(input).value0);
} | [
"private",
"<",
"L",
"extends",
"UriBaseListener",
">",
"void",
"analyzePathInternal",
"(",
"final",
"String",
"input",
",",
"L",
"listener",
")",
"{",
"pathSegmentIndex",
"=",
"-",
"1",
";",
"walker",
".",
"walk",
"(",
"listener",
",",
"preparePath",
"(",
... | Analyze path internal.
@param <L> the generic type
@param input the input
@param listener the listener | [
"Analyze",
"path",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L122-L125 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.extractAsMap | public Map<String, ContentUriPlaceHolder> extractAsMap(String input) {
HashMap<String, ContentUriPlaceHolder> result = new HashMap<>();
ArrayList<ContentUriPlaceHolder> list = extractPlaceHoldersFromURI(input, new ArrayList<ContentUriPlaceHolder>());
for (ContentUriPlaceHolder item : list) {
result.put(item.v... | java | public Map<String, ContentUriPlaceHolder> extractAsMap(String input) {
HashMap<String, ContentUriPlaceHolder> result = new HashMap<>();
ArrayList<ContentUriPlaceHolder> list = extractPlaceHoldersFromURI(input, new ArrayList<ContentUriPlaceHolder>());
for (ContentUriPlaceHolder item : list) {
result.put(item.v... | [
"public",
"Map",
"<",
"String",
",",
"ContentUriPlaceHolder",
">",
"extractAsMap",
"(",
"String",
"input",
")",
"{",
"HashMap",
"<",
"String",
",",
"ContentUriPlaceHolder",
">",
"result",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"ArrayList",
"<",
"Content... | Extract all parameters from URI as a map.
@param input the input
@return the map | [
"Extract",
"all",
"parameters",
"from",
"URI",
"as",
"a",
"map",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L143-L152 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.extractFromPath | public List<ContentUriPlaceHolder> extractFromPath(String input) {
final List<ContentUriPlaceHolder> result = new ArrayList<>();
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzePathInternal(input, new UriBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterContex... | java | public List<ContentUriPlaceHolder> extractFromPath(String input) {
final List<ContentUriPlaceHolder> result = new ArrayList<>();
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzePathInternal(input, new UriBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterContex... | [
"public",
"List",
"<",
"ContentUriPlaceHolder",
">",
"extractFromPath",
"(",
"String",
"input",
")",
"{",
"final",
"List",
"<",
"ContentUriPlaceHolder",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"One",
"<",
"Boolean",
">",
"valid"... | Extract from path.
@param input the input
@return the list | [
"Extract",
"from",
"path",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L160-L179 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.extractPlaceHoldersFromURI | private <L extends Collection<ContentUriPlaceHolder>> L extractPlaceHoldersFromURI(String uri, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(uri, new UriBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterContext ctx) {
result.add(... | java | private <L extends Collection<ContentUriPlaceHolder>> L extractPlaceHoldersFromURI(String uri, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(uri, new UriBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterContext ctx) {
result.add(... | [
"private",
"<",
"L",
"extends",
"Collection",
"<",
"ContentUriPlaceHolder",
">",
">",
"L",
"extractPlaceHoldersFromURI",
"(",
"String",
"uri",
",",
"final",
"L",
"result",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"valid",
"=",
"new",
"One",
"<>",
"("... | Extract place holders from URI.
@param <L> the generic type
@param uri the uri
@param result the result
@return the l | [
"Extract",
"place",
"holders",
"from",
"URI",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L189-L207 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.preparePath | private Pair<ParserRuleContext, CommonTokenStream> preparePath(final String input) {
UriLexer lexer = new UriLexer(CharStreams.fromString(input));
CommonTokenStream tokens = new CommonTokenStream(lexer);
UriParser parser = new UriParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(new Cont... | java | private Pair<ParserRuleContext, CommonTokenStream> preparePath(final String input) {
UriLexer lexer = new UriLexer(CharStreams.fromString(input));
CommonTokenStream tokens = new CommonTokenStream(lexer);
UriParser parser = new UriParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(new Cont... | [
"private",
"Pair",
"<",
"ParserRuleContext",
",",
"CommonTokenStream",
">",
"preparePath",
"(",
"final",
"String",
"input",
")",
"{",
"UriLexer",
"lexer",
"=",
"new",
"UriLexer",
"(",
"CharStreams",
".",
"fromString",
"(",
"input",
")",
")",
";",
"CommonTokenS... | Prepare path.
@param input the input
@return the pair | [
"Prepare",
"path",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L215-L230 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.prepareUri | private Pair<ParserRuleContext, CommonTokenStream> prepareUri(final String input) {
UriLexer lexer = new UriLexer(CharStreams.fromString(input));
CommonTokenStream tokens = new CommonTokenStream(lexer);
UriParser parser = new UriParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(new Conte... | java | private Pair<ParserRuleContext, CommonTokenStream> prepareUri(final String input) {
UriLexer lexer = new UriLexer(CharStreams.fromString(input));
CommonTokenStream tokens = new CommonTokenStream(lexer);
UriParser parser = new UriParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(new Conte... | [
"private",
"Pair",
"<",
"ParserRuleContext",
",",
"CommonTokenStream",
">",
"prepareUri",
"(",
"final",
"String",
"input",
")",
"{",
"UriLexer",
"lexer",
"=",
"new",
"UriLexer",
"(",
"CharStreams",
".",
"fromString",
"(",
"input",
")",
")",
";",
"CommonTokenSt... | Prepare uri.
@param input the input
@return the pair | [
"Prepare",
"uri",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L238-L269 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java | ContentUriChecker.replaceInternalFromUri | private String replaceInternalFromUri(String input, final List<Triple<Token, Token, String>> replace, UriBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareUri(input);
pathSegmentIndex = -1;
walker.walk(rewriterListener, parser.value0);
TokenStreamRewriter rewriter = ne... | java | private String replaceInternalFromUri(String input, final List<Triple<Token, Token, String>> replace, UriBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareUri(input);
pathSegmentIndex = -1;
walker.walk(rewriterListener, parser.value0);
TokenStreamRewriter rewriter = ne... | [
"private",
"String",
"replaceInternalFromUri",
"(",
"String",
"input",
",",
"final",
"List",
"<",
"Triple",
"<",
"Token",
",",
"Token",
",",
"String",
">",
">",
"replace",
",",
"UriBaseListener",
"rewriterListener",
")",
"{",
"Pair",
"<",
"ParserRuleContext",
... | Replace internal from uri.
@param input the input
@param replace the replace
@param rewriterListener the rewriter listener
@return the string | [
"Replace",
"internal",
"from",
"uri",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/uri/ContentUriChecker.java#L279-L291 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BaseProcessor.java | BaseProcessor.parseBindType | protected void parseBindType(RoundEnvironment roundEnv) {
for (Element item : roundEnv.getElementsAnnotatedWith(BindType.class)) {
AssertKripton.assertTrueOrInvalidKindForAnnotationException(item.getKind() == ElementKind.CLASS, item, BindType.class);
globalBeanElements.put(item.toString(), (TypeElement) item... | java | protected void parseBindType(RoundEnvironment roundEnv) {
for (Element item : roundEnv.getElementsAnnotatedWith(BindType.class)) {
AssertKripton.assertTrueOrInvalidKindForAnnotationException(item.getKind() == ElementKind.CLASS, item, BindType.class);
globalBeanElements.put(item.toString(), (TypeElement) item... | [
"protected",
"void",
"parseBindType",
"(",
"RoundEnvironment",
"roundEnv",
")",
"{",
"for",
"(",
"Element",
"item",
":",
"roundEnv",
".",
"getElementsAnnotatedWith",
"(",
"BindType",
".",
"class",
")",
")",
"{",
"AssertKripton",
".",
"assertTrueOrInvalidKindForAnnot... | build bindType elements map.
@param roundEnv the round env | [
"build",
"bindType",
"elements",
"map",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BaseProcessor.java#L213-L220 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateParserOnXmlEndElement | private static void generateParserOnXmlEndElement(BindTypeContext context, MethodSpec.Builder methodBuilder,
String instanceName, String parserName, BindEntity entity) {
methodBuilder.beginControlFlow("if (elementName.equals($L.getName()))", parserName);
methodBuilder.addStatement("currentTag = elementName");
... | java | private static void generateParserOnXmlEndElement(BindTypeContext context, MethodSpec.Builder methodBuilder,
String instanceName, String parserName, BindEntity entity) {
methodBuilder.beginControlFlow("if (elementName.equals($L.getName()))", parserName);
methodBuilder.addStatement("currentTag = elementName");
... | [
"private",
"static",
"void",
"generateParserOnXmlEndElement",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"instanceName",
",",
"String",
"parserName",
",",
"BindEntity",
"entity",
")",
"{",
"methodBuilder",
"."... | Generate parser on xml end element.
@param context
the context
@param methodBuilder
the method builder
@param instanceName
the instance name
@param parserName
the parser name
@param entity
the entity | [
"Generate",
"parser",
"on",
"xml",
"end",
"element",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L345-L352 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateParseOnXmlAttributes | private static void generateParseOnXmlAttributes(BindTypeContext context, MethodSpec.Builder methodBuilder,
BindEntity entity) {
BindTransform bindTransform;
int count = 0;
// count property to manage
{
// for each elements
for (BindProperty property : entity.getCollection()) {
if (property.xmlInf... | java | private static void generateParseOnXmlAttributes(BindTypeContext context, MethodSpec.Builder methodBuilder,
BindEntity entity) {
BindTransform bindTransform;
int count = 0;
// count property to manage
{
// for each elements
for (BindProperty property : entity.getCollection()) {
if (property.xmlInf... | [
"private",
"static",
"void",
"generateParseOnXmlAttributes",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"BindEntity",
"entity",
")",
"{",
"BindTransform",
"bindTransform",
";",
"int",
"count",
"=",
"0",
";",
"// count... | Generate parse on xml attributes.
@param context
the context
@param methodBuilder
the method builder
@param entity
the entity | [
"Generate",
"parse",
"on",
"xml",
"attributes",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L364-L419 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateParserOnXmlStartElement | private static void generateParserOnXmlStartElement(BindTypeContext context, MethodSpec.Builder methodBuilder,
String instanceName, String parserName, BindEntity entity) {
BindTransform bindTransform;
// start and inner bean
methodBuilder.addStatement("currentTag = xmlParser.getName().toString()");
int coun... | java | private static void generateParserOnXmlStartElement(BindTypeContext context, MethodSpec.Builder methodBuilder,
String instanceName, String parserName, BindEntity entity) {
BindTransform bindTransform;
// start and inner bean
methodBuilder.addStatement("currentTag = xmlParser.getName().toString()");
int coun... | [
"private",
"static",
"void",
"generateParserOnXmlStartElement",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"instanceName",
",",
"String",
"parserName",
",",
"BindEntity",
"entity",
")",
"{",
"BindTransform",
"... | Generate parser on xml start element.
@param context
the context
@param methodBuilder
the method builder
@param instanceName
the instance name
@param parserName
the parser name
@param entity
the entity | [
"Generate",
"parser",
"on",
"xml",
"start",
"element",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L435-L496 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateParserOnXmlCharacters | private static void generateParserOnXmlCharacters(BindTypeContext context, MethodSpec.Builder methodBuilder,
String instanceName, String parserName, BindEntity entity) {
BindTransform bindTransform;
int count = 0;
for (BindProperty property : entity.getCollection()) {
if (property.xmlInfo.xmlType != XmlType... | java | private static void generateParserOnXmlCharacters(BindTypeContext context, MethodSpec.Builder methodBuilder,
String instanceName, String parserName, BindEntity entity) {
BindTransform bindTransform;
int count = 0;
for (BindProperty property : entity.getCollection()) {
if (property.xmlInfo.xmlType != XmlType... | [
"private",
"static",
"void",
"generateParserOnXmlCharacters",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"instanceName",
",",
"String",
"parserName",
",",
"BindEntity",
"entity",
")",
"{",
"BindTransform",
"bi... | Parse entity properties and write code to read only CData Text fields.
@param context
the context
@param methodBuilder
the method builder
@param instanceName
the instance name
@param parserName
the parser name
@param entity
the entity | [
"Parse",
"entity",
"properties",
"and",
"write",
"code",
"to",
"read",
"only",
"CData",
"Text",
"fields",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L512-L532 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateParseOnJackson | private static void generateParseOnJackson(BindTypeContext context, BindEntity entity) {
// @formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("parseOnJackson").addJavadoc("parse with jackson\n")
.addAnnotation(Override.class).addModifiers(Modifier.PUBLIC)
// .addParameter(typeName(A... | java | private static void generateParseOnJackson(BindTypeContext context, BindEntity entity) {
// @formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("parseOnJackson").addJavadoc("parse with jackson\n")
.addAnnotation(Override.class).addModifiers(Modifier.PUBLIC)
// .addParameter(typeName(A... | [
"private",
"static",
"void",
"generateParseOnJackson",
"(",
"BindTypeContext",
"context",
",",
"BindEntity",
"entity",
")",
"{",
"// @formatter:off",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"parseOnJackson\"",
")",
... | Generate parse on jackson.
@param context
the context
@param entity
the entity | [
"Generate",
"parse",
"on",
"jackson",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L542-L613 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateSerializeOnJackson | private static void generateSerializeOnJackson(BindTypeContext context, BindEntity entity) {
// @formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("serializeOnJackson").addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC)
// .addParameter(typeName(AbstractJacksonContext.class... | java | private static void generateSerializeOnJackson(BindTypeContext context, BindEntity entity) {
// @formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("serializeOnJackson").addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC)
// .addParameter(typeName(AbstractJacksonContext.class... | [
"private",
"static",
"void",
"generateSerializeOnJackson",
"(",
"BindTypeContext",
"context",
",",
"BindEntity",
"entity",
")",
"{",
"// @formatter:off",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"serializeOnJackson\"",... | Generate serialize on jackson.
@param context
the context
@param entity
the entity | [
"Generate",
"serialize",
"on",
"jackson",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L706-L749 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java | BindTypeBuilder.generateSerializeOnXml | private static void generateSerializeOnXml(BindTypeContext context, BindEntity entity) {
// @formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("serializeOnXml")
.addJavadoc("method for xml serialization\n").addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC)
// .addParam... | java | private static void generateSerializeOnXml(BindTypeContext context, BindEntity entity) {
// @formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("serializeOnXml")
.addJavadoc("method for xml serialization\n").addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC)
// .addParam... | [
"private",
"static",
"void",
"generateSerializeOnXml",
"(",
"BindTypeContext",
"context",
",",
"BindEntity",
"entity",
")",
"{",
"// @formatter:off",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"serializeOnXml\"",
")",
... | Generate serialize on xml.
@param context
the context
@param entity
the entity | [
"Generate",
"serialize",
"on",
"xml",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L813-L872 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/PagedResultImpl.java | PagedResultImpl.nextPage | @Override
public void nextPage() {
if (!paged) {
this.firstPage();
paged = true;
} else if (!isLast()) {
offset = (getPageNumber() + 1) * pageSize;
execute();
}
} | java | @Override
public void nextPage() {
if (!paged) {
this.firstPage();
paged = true;
} else if (!isLast()) {
offset = (getPageNumber() + 1) * pageSize;
execute();
}
} | [
"@",
"Override",
"public",
"void",
"nextPage",
"(",
")",
"{",
"if",
"(",
"!",
"paged",
")",
"{",
"this",
".",
"firstPage",
"(",
")",
";",
"paged",
"=",
"true",
";",
"}",
"else",
"if",
"(",
"!",
"isLast",
"(",
")",
")",
"{",
"offset",
"=",
"(",
... | Next page.
@return true, if successful | [
"Next",
"page",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/PagedResultImpl.java#L150-L160 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.buildJQL | public static JQL buildJQL(final SQLiteModelMethod method, String preparedJql) {
Map<JQLDynamicStatementType, String> dynamicReplace = new HashMap<>();
final JQL result = new JQL();
// for each method's parameter
forEachParameter(method, new OnMethodParameterListener() {
@Override
public void onMethodPa... | java | public static JQL buildJQL(final SQLiteModelMethod method, String preparedJql) {
Map<JQLDynamicStatementType, String> dynamicReplace = new HashMap<>();
final JQL result = new JQL();
// for each method's parameter
forEachParameter(method, new OnMethodParameterListener() {
@Override
public void onMethodPa... | [
"public",
"static",
"JQL",
"buildJQL",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"String",
"preparedJql",
")",
"{",
"Map",
"<",
"JQLDynamicStatementType",
",",
"String",
">",
"dynamicReplace",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"final",
"JQL",... | Builds the JQL.
@param method
the method
@param preparedJql
the prepared jql
@return the jql | [
"Builds",
"the",
"JQL",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L151-L186 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.checkFieldsDefinitions | private static void checkFieldsDefinitions(SQLiteModelMethod method, Class<? extends Annotation> annotation) {
List<String> includedFields = AnnotationUtility.extractAsStringArray(method.getElement(), annotation, AnnotationAttributeType.FIELDS);
List<String> excludedFields = AnnotationUtility.extractAsStringArray(m... | java | private static void checkFieldsDefinitions(SQLiteModelMethod method, Class<? extends Annotation> annotation) {
List<String> includedFields = AnnotationUtility.extractAsStringArray(method.getElement(), annotation, AnnotationAttributeType.FIELDS);
List<String> excludedFields = AnnotationUtility.extractAsStringArray(m... | [
"private",
"static",
"void",
"checkFieldsDefinitions",
"(",
"SQLiteModelMethod",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"List",
"<",
"String",
">",
"includedFields",
"=",
"AnnotationUtility",
".",
"extractAsStringArra... | Check fields definitions.
@param method
the method
@param annotation
the annotation | [
"Check",
"fields",
"definitions",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L196-L205 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.extractFieldsFromAnnotation | private static <A extends Annotation> LinkedHashSet<String> extractFieldsFromAnnotation(final SQLiteModelMethod method, Class<A> annotationClazz, final boolean includePrimaryKey) {
final SQLiteEntity entity = method.getEntity();
List<String> annotatedFieldValues = AnnotationUtility.extractAsStringArray(method.getE... | java | private static <A extends Annotation> LinkedHashSet<String> extractFieldsFromAnnotation(final SQLiteModelMethod method, Class<A> annotationClazz, final boolean includePrimaryKey) {
final SQLiteEntity entity = method.getEntity();
List<String> annotatedFieldValues = AnnotationUtility.extractAsStringArray(method.getE... | [
"private",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"LinkedHashSet",
"<",
"String",
">",
"extractFieldsFromAnnotation",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"Class",
"<",
"A",
">",
"annotationClazz",
",",
"final",
"boolean",
"includePrimaryKey"... | Extract fields from annotation.
@param <A>
the generic type
@param method
the method
@param annotationClazz
the annotation clazz
@param includePrimaryKey
the include primary key
@return the linked hash set | [
"Extract",
"fields",
"from",
"annotation",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L817-L865 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.isInSet | private static boolean isInSet(String value, Set<JQLPlaceHolder> parametersUsedInWhereConditions) {
for (JQLPlaceHolder ph : parametersUsedInWhereConditions) {
if (ph.value.equals(value))
return true;
}
return false;
} | java | private static boolean isInSet(String value, Set<JQLPlaceHolder> parametersUsedInWhereConditions) {
for (JQLPlaceHolder ph : parametersUsedInWhereConditions) {
if (ph.value.equals(value))
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"isInSet",
"(",
"String",
"value",
",",
"Set",
"<",
"JQLPlaceHolder",
">",
"parametersUsedInWhereConditions",
")",
"{",
"for",
"(",
"JQLPlaceHolder",
"ph",
":",
"parametersUsedInWhereConditions",
")",
"{",
"if",
"(",
"ph",
".",
"v... | Checks if is in set.
@param value
the value
@param parametersUsedInWhereConditions
the parameters used in where conditions
@return true, if is in set | [
"Checks",
"if",
"is",
"in",
"set",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L876-L882 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.defineOrderByStatement | private static <L extends Annotation> String defineOrderByStatement(final SQLiteModelMethod method, final JQL result, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
StringBuilder builder = new StringBuilder();
String orderBy = AnnotationUtility.extractAsString(method.getElement(), anno... | java | private static <L extends Annotation> String defineOrderByStatement(final SQLiteModelMethod method, final JQL result, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
StringBuilder builder = new StringBuilder();
String orderBy = AnnotationUtility.extractAsString(method.getElement(), anno... | [
"private",
"static",
"<",
"L",
"extends",
"Annotation",
">",
"String",
"defineOrderByStatement",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"final",
"JQL",
"result",
",",
"Class",
"<",
"L",
">",
"annotation",
",",
"Map",
"<",
"JQLDynamicStatementType",
",... | Define ORDER BY statement.
@param <L>
the generic type
@param method
the method
@param result
the result
@param annotation
the annotation
@param dynamicReplace
the dynamic replace
@return the string | [
"Define",
"ORDER",
"BY",
"statement",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L962-L1016 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.forEachParameter | private static void forEachParameter(SQLiteModelMethod method, OnMethodParameterListener listener) {
for (VariableElement p : method.getElement().getParameters()) {
listener.onMethodParameter(p);
}
} | java | private static void forEachParameter(SQLiteModelMethod method, OnMethodParameterListener listener) {
for (VariableElement p : method.getElement().getParameters()) {
listener.onMethodParameter(p);
}
} | [
"private",
"static",
"void",
"forEachParameter",
"(",
"SQLiteModelMethod",
"method",
",",
"OnMethodParameterListener",
"listener",
")",
"{",
"for",
"(",
"VariableElement",
"p",
":",
"method",
".",
"getElement",
"(",
")",
".",
"getParameters",
"(",
")",
")",
"{",... | For each parameter.
@param method
the method
@param listener
the listener | [
"For",
"each",
"parameter",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L1106-L1110 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/utils/AnnotationProcessorUtilis.java | AnnotationProcessorUtilis.infoOnGeneratedClasses | public static void infoOnGeneratedClasses(Class<? extends Annotation> annotation, String packageName, String className) {
String msg = String.format("class '%s' in package '%s' is generated by '@%s' annotation processor", className, packageName, annotation.getSimpleName());
printMessage(msg);
} | java | public static void infoOnGeneratedClasses(Class<? extends Annotation> annotation, String packageName, String className) {
String msg = String.format("class '%s' in package '%s' is generated by '@%s' annotation processor", className, packageName, annotation.getSimpleName());
printMessage(msg);
} | [
"public",
"static",
"void",
"infoOnGeneratedClasses",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"String",
"packageName",
",",
"String",
"className",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"class '%s' in pac... | KRIPTON_DEBUG info about generated classes.
@param annotation the annotation
@param packageName the package name
@param className the class name | [
"KRIPTON_DEBUG",
"info",
"about",
"generated",
"classes",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/utils/AnnotationProcessorUtilis.java#L49-L53 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/utils/AnnotationProcessorUtilis.java | AnnotationProcessorUtilis.infoOnGeneratedFile | public static void infoOnGeneratedFile(Class<BindDataSource> annotation, File schemaCreateFile) {
String msg = String.format("file '%s' in directory '%s' is generated by '@%s' annotation processor", schemaCreateFile.getName(), schemaCreateFile.getParentFile(), annotation.getSimpleName());
printMessage(msg);
} | java | public static void infoOnGeneratedFile(Class<BindDataSource> annotation, File schemaCreateFile) {
String msg = String.format("file '%s' in directory '%s' is generated by '@%s' annotation processor", schemaCreateFile.getName(), schemaCreateFile.getParentFile(), annotation.getSimpleName());
printMessage(msg);
} | [
"public",
"static",
"void",
"infoOnGeneratedFile",
"(",
"Class",
"<",
"BindDataSource",
">",
"annotation",
",",
"File",
"schemaCreateFile",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"file '%s' in directory '%s' is generated by '@%s' annotation proces... | Info on generated file.
@param annotation the annotation
@param schemaCreateFile the schema create file | [
"Info",
"on",
"generated",
"file",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/utils/AnnotationProcessorUtilis.java#L72-L76 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java | SqlSelectBuilder.getNameParameterOfType | public static String getNameParameterOfType(ModelMethod method, TypeName parameter) {
for (Pair<String, TypeName> item : method.getParameters()) {
if (item.value1.equals(parameter)) {
return item.value0;
}
}
return null;
} | java | public static String getNameParameterOfType(ModelMethod method, TypeName parameter) {
for (Pair<String, TypeName> item : method.getParameters()) {
if (item.value1.equals(parameter)) {
return item.value0;
}
}
return null;
} | [
"public",
"static",
"String",
"getNameParameterOfType",
"(",
"ModelMethod",
"method",
",",
"TypeName",
"parameter",
")",
"{",
"for",
"(",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
":",
"method",
".",
"getParameters",
"(",
")",
")",
"{",
"if",
"(... | Gets the name parameter of type.
@param method
the method
@param parameter
the parameter
@return the name parameter of type | [
"Gets",
"the",
"name",
"parameter",
"of",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java#L69-L77 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java | SqlSelectBuilder.generateSelect | public static void generateSelect(Builder builder, SQLiteModelMethod method) throws ClassNotFoundException {
SelectType selectResultType = SelectBuilderUtility.detectSelectType(method);
// generate select method
selectResultType.generate(builder, method);
if (method.hasLiveData()) {
// generate
selectRe... | java | public static void generateSelect(Builder builder, SQLiteModelMethod method) throws ClassNotFoundException {
SelectType selectResultType = SelectBuilderUtility.detectSelectType(method);
// generate select method
selectResultType.generate(builder, method);
if (method.hasLiveData()) {
// generate
selectRe... | [
"public",
"static",
"void",
"generateSelect",
"(",
"Builder",
"builder",
",",
"SQLiteModelMethod",
"method",
")",
"throws",
"ClassNotFoundException",
"{",
"SelectType",
"selectResultType",
"=",
"SelectBuilderUtility",
".",
"detectSelectType",
"(",
"method",
")",
";",
... | Generate select.
@param builder
the builder
@param method
the method
@throws ClassNotFoundException
the class not found exception | [
"Generate",
"select",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java#L89-L104 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java | SqlSelectBuilder.convertJQL2SQL | public static String convertJQL2SQL(final SQLiteModelMethod method, final boolean replaceWithQuestion) {
JQLChecker jqlChecker = JQLChecker.getInstance();
// convert jql to sql
String sql = jqlChecker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {
@Override
public String onBindParameter(... | java | public static String convertJQL2SQL(final SQLiteModelMethod method, final boolean replaceWithQuestion) {
JQLChecker jqlChecker = JQLChecker.getInstance();
// convert jql to sql
String sql = jqlChecker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {
@Override
public String onBindParameter(... | [
"public",
"static",
"String",
"convertJQL2SQL",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"final",
"boolean",
"replaceWithQuestion",
")",
"{",
"JQLChecker",
"jqlChecker",
"=",
"JQLChecker",
".",
"getInstance",
"(",
")",
";",
"// convert jql to sql",
"String",
... | Convert JQL 2 SQL.
@param method
the method
@param replaceWithQuestion
the replace with question
@return the string | [
"Convert",
"JQL",
"2",
"SQL",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java#L438-L469 | train |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/core/internal/SafeIterableMap.java | SafeIterableMap.descendingIterator | public Iterator<Map.Entry<K, V>> descendingIterator() {
DescendingIterator<K, V> iterator = new DescendingIterator<>(mEnd, mStart);
mIterators.put(iterator, false);
return iterator;
} | java | public Iterator<Map.Entry<K, V>> descendingIterator() {
DescendingIterator<K, V> iterator = new DescendingIterator<>(mEnd, mStart);
mIterators.put(iterator, false);
return iterator;
} | [
"public",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"descendingIterator",
"(",
")",
"{",
"DescendingIterator",
"<",
"K",
",",
"V",
">",
"iterator",
"=",
"new",
"DescendingIterator",
"<>",
"(",
"mEnd",
",",
"mStart",
")",
";",
... | Descending iterator.
@return an descending iterator, which doesn't include new elements added during an
iteration. | [
"Descending",
"iterator",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/core/internal/SafeIterableMap.java#L173-L177 | train |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/core/internal/SafeIterableMap.java | SafeIterableMap.iteratorWithAdditions | public IteratorWithAdditions iteratorWithAdditions() {
@SuppressWarnings("unchecked")
IteratorWithAdditions iterator = new IteratorWithAdditions();
mIterators.put(iterator, false);
return iterator;
} | java | public IteratorWithAdditions iteratorWithAdditions() {
@SuppressWarnings("unchecked")
IteratorWithAdditions iterator = new IteratorWithAdditions();
mIterators.put(iterator, false);
return iterator;
} | [
"public",
"IteratorWithAdditions",
"iteratorWithAdditions",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"IteratorWithAdditions",
"iterator",
"=",
"new",
"IteratorWithAdditions",
"(",
")",
";",
"mIterators",
".",
"put",
"(",
"iterator",
",",
"f... | return an iterator with additions.
@return the iterator with additions | [
"return",
"an",
"iterator",
"with",
"additions",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/core/internal/SafeIterableMap.java#L184-L189 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/core/JavadocUtility.java | JavadocUtility.generateJavadocGeneratedBy | public static void generateJavadocGeneratedBy(Builder builder) {
if (!BindDataSourceSubProcessor.JUNIT_TEST_MODE) {
builder.addJavadoc("<p><strong>This class is generated by Kripton Annotation Processor - v. $L</strong></p>\n", Version.getVersion());
builder.addJavadoc("<p><strong>Generation-time: $L</strong></... | java | public static void generateJavadocGeneratedBy(Builder builder) {
if (!BindDataSourceSubProcessor.JUNIT_TEST_MODE) {
builder.addJavadoc("<p><strong>This class is generated by Kripton Annotation Processor - v. $L</strong></p>\n", Version.getVersion());
builder.addJavadoc("<p><strong>Generation-time: $L</strong></... | [
"public",
"static",
"void",
"generateJavadocGeneratedBy",
"(",
"Builder",
"builder",
")",
"{",
"if",
"(",
"!",
"BindDataSourceSubProcessor",
".",
"JUNIT_TEST_MODE",
")",
"{",
"builder",
".",
"addJavadoc",
"(",
"\"<p><strong>This class is generated by Kripton Annotation Proc... | Generate javadoc generated by.
@param builder
the builder | [
"Generate",
"javadoc",
"generated",
"by",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/core/JavadocUtility.java#L61-L66 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.generateColumnCheckSet | public static String generateColumnCheckSet(TypeSpec.Builder builder, SQLiteModelMethod method, Set<String> columnNames) {
String columnNameSet = method.contentProviderMethodName + "ColumnSet";
StringBuilder initBuilder = new StringBuilder();
String temp = "";
for (String item : columnNames) {
initBuilder.a... | java | public static String generateColumnCheckSet(TypeSpec.Builder builder, SQLiteModelMethod method, Set<String> columnNames) {
String columnNameSet = method.contentProviderMethodName + "ColumnSet";
StringBuilder initBuilder = new StringBuilder();
String temp = "";
for (String item : columnNames) {
initBuilder.a... | [
"public",
"static",
"String",
"generateColumnCheckSet",
"(",
"TypeSpec",
".",
"Builder",
"builder",
",",
"SQLiteModelMethod",
"method",
",",
"Set",
"<",
"String",
">",
"columnNames",
")",
"{",
"String",
"columnNameSet",
"=",
"method",
".",
"contentProviderMethodName... | check used columns.
@param builder
the builder
@param method
the method
@param columnNames
the column names
@return name of column name set | [
"check",
"used",
"columns",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L74-L90 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.removeDynamicPlaceHolder | static List<JQLPlaceHolder> removeDynamicPlaceHolder(List<JQLPlaceHolder> placeHolders) {
List<JQLPlaceHolder> result = new ArrayList<>();
for (JQLPlaceHolder item : placeHolders) {
if (item.type != JQLPlaceHolderType.DYNAMIC_SQL) {
result.add(item);
}
}
return result;
} | java | static List<JQLPlaceHolder> removeDynamicPlaceHolder(List<JQLPlaceHolder> placeHolders) {
List<JQLPlaceHolder> result = new ArrayList<>();
for (JQLPlaceHolder item : placeHolders) {
if (item.type != JQLPlaceHolderType.DYNAMIC_SQL) {
result.add(item);
}
}
return result;
} | [
"static",
"List",
"<",
"JQLPlaceHolder",
">",
"removeDynamicPlaceHolder",
"(",
"List",
"<",
"JQLPlaceHolder",
">",
"placeHolders",
")",
"{",
"List",
"<",
"JQLPlaceHolder",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"JQLPlaceHolder... | Removes the dynamic place holder.
@param placeHolders
the place holders
@return the list | [
"Removes",
"the",
"dynamic",
"place",
"holder",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L129-L139 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.validate | static boolean validate(String value, List<JQLPlaceHolder> placeHolders, int pos) {
return placeHolders.get(pos).value.equals(value);
} | java | static boolean validate(String value, List<JQLPlaceHolder> placeHolders, int pos) {
return placeHolders.get(pos).value.equals(value);
} | [
"static",
"boolean",
"validate",
"(",
"String",
"value",
",",
"List",
"<",
"JQLPlaceHolder",
">",
"placeHolders",
",",
"int",
"pos",
")",
"{",
"return",
"placeHolders",
".",
"get",
"(",
"pos",
")",
".",
"value",
".",
"equals",
"(",
"value",
")",
";",
"... | look for variable name in place holders defined through path of content
provider.
@param value
the value
@param placeHolders
the place holders
@param pos
the pos
@return <code>true</code> if we found it path | [
"look",
"for",
"variable",
"name",
"in",
"place",
"holders",
"defined",
"through",
"path",
"of",
"content",
"provider",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L153-L155 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.generateJavaDocForContentProvider | public static void generateJavaDocForContentProvider(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
// javadoc
String operation = method.jql.operationType.toString();
methodBuilder.addJavadoc("<h1>Content provider URI ($L operation):</h1>\n", operation);
methodBuilder.addJavadoc("<pre>$L</... | java | public static void generateJavaDocForContentProvider(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
// javadoc
String operation = method.jql.operationType.toString();
methodBuilder.addJavadoc("<h1>Content provider URI ($L operation):</h1>\n", operation);
methodBuilder.addJavadoc("<pre>$L</... | [
"public",
"static",
"void",
"generateJavaDocForContentProvider",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"// javadoc",
"String",
"operation",
"=",
"method",
".",
"jql",
".",
"operationType",
".",
"to... | Generate java doc for content provider.
@param method
the method
@param methodBuilder
the method builder | [
"Generate",
"java",
"doc",
"for",
"content",
"provider",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L165-L210 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.forEachMethods | public static void forEachMethods(TypeElement typeElement, MethodFoundListener listener) {
Elements elementUtils = BaseProcessor.elementUtils;
List<? extends Element> list = elementUtils.getAllMembers(typeElement);
for (Element item : list) {
if (item.getKind() == ElementKind.METHOD) {
listener.onMethod((... | java | public static void forEachMethods(TypeElement typeElement, MethodFoundListener listener) {
Elements elementUtils = BaseProcessor.elementUtils;
List<? extends Element> list = elementUtils.getAllMembers(typeElement);
for (Element item : list) {
if (item.getKind() == ElementKind.METHOD) {
listener.onMethod((... | [
"public",
"static",
"void",
"forEachMethods",
"(",
"TypeElement",
"typeElement",
",",
"MethodFoundListener",
"listener",
")",
"{",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",
"elementUtils",
";",
"List",
"<",
"?",
"extends",
"Element",
">",
"list",
"=",... | Iterate over methods.
@param typeElement
the type element
@param listener
the listener | [
"Iterate",
"over",
"methods",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L347-L356 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.searchInEachParameter | public static Pair<String, TypeName> searchInEachParameter(ModelMethod method, OnParameterListener listener) {
for (Pair<String, TypeName> item : method.getParameters()) {
if (listener.onParameter(item)) {
return item;
}
}
return null;
} | java | public static Pair<String, TypeName> searchInEachParameter(ModelMethod method, OnParameterListener listener) {
for (Pair<String, TypeName> item : method.getParameters()) {
if (listener.onParameter(item)) {
return item;
}
}
return null;
} | [
"public",
"static",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"searchInEachParameter",
"(",
"ModelMethod",
"method",
",",
"OnParameterListener",
"listener",
")",
"{",
"for",
"(",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
":",
"method",
".",
"ge... | Iterate for each method's parameter
@param method
@param listener
@return | [
"Iterate",
"for",
"each",
"method",
"s",
"parameter"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L382-L390 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.countParameterOfType | public static int countParameterOfType(ModelMethod method, TypeName parameter) {
int counter = 0;
for (Pair<String, TypeName> item : method.getParameters()) {
if (item.value1.equals(parameter)) {
counter++;
}
}
return counter;
} | java | public static int countParameterOfType(ModelMethod method, TypeName parameter) {
int counter = 0;
for (Pair<String, TypeName> item : method.getParameters()) {
if (item.value1.equals(parameter)) {
counter++;
}
}
return counter;
} | [
"public",
"static",
"int",
"countParameterOfType",
"(",
"ModelMethod",
"method",
",",
"TypeName",
"parameter",
")",
"{",
"int",
"counter",
"=",
"0",
";",
"for",
"(",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
":",
"method",
".",
"getParameters",
... | Count parameter of type.
@param method
the method
@param parameter
the parameter
@return the int | [
"Count",
"parameter",
"of",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L401-L410 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.generateLogForContentValuesContentProvider | public static void generateLogForContentValuesContentProvider(SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
methodBuilder.addCode("\n// log for content values -- BEGIN\n");
methodBuilder.addStatement("Object _contentValue");
methodBuilder.beginControlFlow("for (String _contentKey:_contentValues.va... | java | public static void generateLogForContentValuesContentProvider(SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
methodBuilder.addCode("\n// log for content values -- BEGIN\n");
methodBuilder.addStatement("Object _contentValue");
methodBuilder.beginControlFlow("for (String _contentKey:_contentValues.va... | [
"public",
"static",
"void",
"generateLogForContentValuesContentProvider",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"methodBuilder",
".",
"addCode",
"(",
"\"\\n// log for content values -- BEGIN\\n\"",
")",
";",
"metho... | Generate log for content values content provider.
@param method
the method
@param methodBuilder
the method builder | [
"Generate",
"log",
"for",
"content",
"values",
"content",
"provider",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L753-L766 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.orderContentValues | public static List<Pair<String, TypeName>> orderContentValues(final SQLiteModelMethod method, final List<Pair<String, TypeName>> updateableParams) {
final List<Pair<String, TypeName>> result = new ArrayList<Pair<String, TypeName>>();
JQLChecker checker = JQLChecker.getInstance();
final One<Boolean> inserMode = n... | java | public static List<Pair<String, TypeName>> orderContentValues(final SQLiteModelMethod method, final List<Pair<String, TypeName>> updateableParams) {
final List<Pair<String, TypeName>> result = new ArrayList<Pair<String, TypeName>>();
JQLChecker checker = JQLChecker.getInstance();
final One<Boolean> inserMode = n... | [
"public",
"static",
"List",
"<",
"Pair",
"<",
"String",
",",
"TypeName",
">",
">",
"orderContentValues",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"final",
"List",
"<",
"Pair",
"<",
"String",
",",
"TypeName",
">",
">",
"updateableParams",
")",
"{",
... | Order content values.
@param method
the method
@param updateableParams
the updateable params
@return the list | [
"Order",
"content",
"values",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L777-L832 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SelectBuilderUtility.java | SelectBuilderUtility.extractReturnType | public static TypeName extractReturnType(final SQLiteModelMethod method) {
SQLiteEntity daoEntity = method.getParent().getEntity();
// if true, field must be associate to ben attributes
TypeName returnTypeName = method.getReturnClass();
TypeName result = null;
if (TypeUtility.isTypeIncludedIn(returnTypeName,... | java | public static TypeName extractReturnType(final SQLiteModelMethod method) {
SQLiteEntity daoEntity = method.getParent().getEntity();
// if true, field must be associate to ben attributes
TypeName returnTypeName = method.getReturnClass();
TypeName result = null;
if (TypeUtility.isTypeIncludedIn(returnTypeName,... | [
"public",
"static",
"TypeName",
"extractReturnType",
"(",
"final",
"SQLiteModelMethod",
"method",
")",
"{",
"SQLiteEntity",
"daoEntity",
"=",
"method",
".",
"getParent",
"(",
")",
".",
"getEntity",
"(",
")",
";",
"// if true, field must be associate to ben attributes",
... | Detect result type.
@param method
@return
@throws ClassNotFoundException | [
"Detect",
"result",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SelectBuilderUtility.java#L189-L260 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java | BindM2MBuilder.generateDaoPart | private void generateDaoPart(M2MEntity entity) {
String daoClassName = entity.daoName.simpleName();
String daoPackageName = entity.daoName.packageName();
String entityPackageName = entity.getPackageName();
String generatedDaoClassName = "Generated" + daoClassName;
AnnotationProcessorUtilis.infoOnGeneratedCl... | java | private void generateDaoPart(M2MEntity entity) {
String daoClassName = entity.daoName.simpleName();
String daoPackageName = entity.daoName.packageName();
String entityPackageName = entity.getPackageName();
String generatedDaoClassName = "Generated" + daoClassName;
AnnotationProcessorUtilis.infoOnGeneratedCl... | [
"private",
"void",
"generateDaoPart",
"(",
"M2MEntity",
"entity",
")",
"{",
"String",
"daoClassName",
"=",
"entity",
".",
"daoName",
".",
"simpleName",
"(",
")",
";",
"String",
"daoPackageName",
"=",
"entity",
".",
"daoName",
".",
"packageName",
"(",
")",
";... | Generate dao part.
@param entity
the entity
@throws IOException
Signals that an I/O exception has occurred. | [
"Generate",
"dao",
"part",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L183-L222 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java | BindM2MBuilder.isMethodAlreadyDefined | private boolean isMethodAlreadyDefined(M2MEntity entity, final String methodName) {
final One<Boolean> found = new One<Boolean>(false);
SqlBuilderHelper.forEachMethods(entity.daoElement, new MethodFoundListener() {
@Override
public void onMethod(ExecutableElement executableMethod) {
if (executableMethod... | java | private boolean isMethodAlreadyDefined(M2MEntity entity, final String methodName) {
final One<Boolean> found = new One<Boolean>(false);
SqlBuilderHelper.forEachMethods(entity.daoElement, new MethodFoundListener() {
@Override
public void onMethod(ExecutableElement executableMethod) {
if (executableMethod... | [
"private",
"boolean",
"isMethodAlreadyDefined",
"(",
"M2MEntity",
"entity",
",",
"final",
"String",
"methodName",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"found",
"=",
"new",
"One",
"<",
"Boolean",
">",
"(",
"false",
")",
";",
"SqlBuilderHelper",
".",... | analyze DAO definition to check if method is already defined.
@param entity
the entity
@param methodName
the method name
@return true, if is method already defined | [
"analyze",
"DAO",
"definition",
"to",
"check",
"if",
"method",
"is",
"already",
"defined",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L313-L328 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java | BindM2MBuilder.generateInsert | private void generateInsert(M2MEntity entity, String packageName) {
if (!isMethodAlreadyDefined(entity, "insert")) {
// @formatter:off
MethodSpec methodSpec = MethodSpec.methodBuilder("insert").addModifiers(Modifier.PUBLIC)
.addModifiers(Modifier.ABSTRACT).addAnnotation(AnnotationSpec.builder(BindSqlInsert... | java | private void generateInsert(M2MEntity entity, String packageName) {
if (!isMethodAlreadyDefined(entity, "insert")) {
// @formatter:off
MethodSpec methodSpec = MethodSpec.methodBuilder("insert").addModifiers(Modifier.PUBLIC)
.addModifiers(Modifier.ABSTRACT).addAnnotation(AnnotationSpec.builder(BindSqlInsert... | [
"private",
"void",
"generateInsert",
"(",
"M2MEntity",
"entity",
",",
"String",
"packageName",
")",
"{",
"if",
"(",
"!",
"isMethodAlreadyDefined",
"(",
"entity",
",",
"\"insert\"",
")",
")",
"{",
"// @formatter:off",
"MethodSpec",
"methodSpec",
"=",
"MethodSpec",
... | Generate insert.
@param entity
the entity
@param packageName
the package name | [
"Generate",
"insert",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L414-L427 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generate | public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
BindDaoFactoryBuilder visitor = new BindDaoFactoryBuilder(elementUtils, filer, schema);
visitor.buildDaoFactoryInterface(elementUtils, filer, schema);
String daoFactoryName = BindDaoFactoryBuilder.gener... | java | public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
BindDaoFactoryBuilder visitor = new BindDaoFactoryBuilder(elementUtils, filer, schema);
visitor.buildDaoFactoryInterface(elementUtils, filer, schema);
String daoFactoryName = BindDaoFactoryBuilder.gener... | [
"public",
"static",
"void",
"generate",
"(",
"Elements",
"elementUtils",
",",
"Filer",
"filer",
",",
"SQLiteDatabaseSchema",
"schema",
")",
"throws",
"Exception",
"{",
"BindDaoFactoryBuilder",
"visitor",
"=",
"new",
"BindDaoFactoryBuilder",
"(",
"elementUtils",
",",
... | Generate database.
@param elementUtils
the element utils
@param filer
the filer
@param schema
the schema
@throws Exception
the exception | [
"Generate",
"database",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L138-L147 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.defineFileName | static String defineFileName(SQLiteDatabaseSchema model) {
int lastIndex = model.fileName.lastIndexOf(".");
String schemaName = model.fileName;
if (lastIndex > -1) {
schemaName = model.fileName.substring(0, lastIndex);
}
schemaName = schemaName.toLowerCase() + "_schema_" + model.version + ".sql";
retu... | java | static String defineFileName(SQLiteDatabaseSchema model) {
int lastIndex = model.fileName.lastIndexOf(".");
String schemaName = model.fileName;
if (lastIndex > -1) {
schemaName = model.fileName.substring(0, lastIndex);
}
schemaName = schemaName.toLowerCase() + "_schema_" + model.version + ".sql";
retu... | [
"static",
"String",
"defineFileName",
"(",
"SQLiteDatabaseSchema",
"model",
")",
"{",
"int",
"lastIndex",
"=",
"model",
".",
"fileName",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"String",
"schemaName",
"=",
"model",
".",
"fileName",
";",
"if",
"(",
"lastI... | Define file name.
@param model
the model
@return the string | [
"Define",
"file",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L206-L217 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generateDataSourceName | public static ClassName generateDataSourceName(SQLiteDatabaseSchema schema) {
String dataSourceName = schema.getName();
dataSourceName = PREFIX + dataSourceName;
PackageElement pkg = BaseProcessor.elementUtils.getPackageOf(schema.getElement());
String packageName = pkg.isUnnamed() ? "" : pkg.getQualifiedName()... | java | public static ClassName generateDataSourceName(SQLiteDatabaseSchema schema) {
String dataSourceName = schema.getName();
dataSourceName = PREFIX + dataSourceName;
PackageElement pkg = BaseProcessor.elementUtils.getPackageOf(schema.getElement());
String packageName = pkg.isUnnamed() ? "" : pkg.getQualifiedName()... | [
"public",
"static",
"ClassName",
"generateDataSourceName",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"String",
"dataSourceName",
"=",
"schema",
".",
"getName",
"(",
")",
";",
"dataSourceName",
"=",
"PREFIX",
"+",
"dataSourceName",
";",
"PackageElement",
"pkg"... | Generate dataSource name.
@param schema
the schema
@return associated class name | [
"Generate",
"dataSource",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L226-L234 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generateDaoUids | public static void generateDaoUids(TypeSpec.Builder classBuilder, SQLiteDatabaseSchema schema) {
for (SQLiteDaoDefinition dao : schema.getCollection()) {
classBuilder.addField(
FieldSpec.builder(Integer.TYPE, dao.daoUidName, Modifier.FINAL, Modifier.STATIC, Modifier.PUBLIC)
.initializer("" + dao.daoU... | java | public static void generateDaoUids(TypeSpec.Builder classBuilder, SQLiteDatabaseSchema schema) {
for (SQLiteDaoDefinition dao : schema.getCollection()) {
classBuilder.addField(
FieldSpec.builder(Integer.TYPE, dao.daoUidName, Modifier.FINAL, Modifier.STATIC, Modifier.PUBLIC)
.initializer("" + dao.daoU... | [
"public",
"static",
"void",
"generateDaoUids",
"(",
"TypeSpec",
".",
"Builder",
"classBuilder",
",",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"for",
"(",
"SQLiteDaoDefinition",
"dao",
":",
"schema",
".",
"getCollection",
"(",
")",
")",
"{",
"classBuilder",
".... | Generate Dao's UID. If specified, prefix will be used to
@param classBuilder
the class builder
@param schema
the schema | [
"Generate",
"Dao",
"s",
"UID",
".",
"If",
"specified",
"prefix",
"will",
"be",
"used",
"to"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L445-L454 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.extractDaoFieldNameForInternalDataSource | private String extractDaoFieldNameForInternalDataSource(SQLiteDaoDefinition dao) {
return "_" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, dao.getName());
} | java | private String extractDaoFieldNameForInternalDataSource(SQLiteDaoDefinition dao) {
return "_" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, dao.getName());
} | [
"private",
"String",
"extractDaoFieldNameForInternalDataSource",
"(",
"SQLiteDaoDefinition",
"dao",
")",
"{",
"return",
"\"_\"",
"+",
"CaseFormat",
".",
"UPPER_CAMEL",
".",
"to",
"(",
"CaseFormat",
".",
"LOWER_CAMEL",
",",
"dao",
".",
"getName",
"(",
")",
")",
"... | Extract dao field name for internal data source.
@param dao
the dao
@return the string | [
"Extract",
"dao",
"field",
"name",
"for",
"internal",
"data",
"source",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L593-L595 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generatePopulate | private void generatePopulate(SQLiteDatabaseSchema schema, MethodSpec.Builder methodBuilder, boolean instance) {
methodBuilder.beginControlFlow("try");
methodBuilder.addStatement("instance.openWritableDatabase()");
methodBuilder.addStatement("instance.close()");
if ((instance && schema.configPopulatorClazz !=... | java | private void generatePopulate(SQLiteDatabaseSchema schema, MethodSpec.Builder methodBuilder, boolean instance) {
methodBuilder.beginControlFlow("try");
methodBuilder.addStatement("instance.openWritableDatabase()");
methodBuilder.addStatement("instance.close()");
if ((instance && schema.configPopulatorClazz !=... | [
"private",
"void",
"generatePopulate",
"(",
"SQLiteDatabaseSchema",
"schema",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"boolean",
"instance",
")",
"{",
"methodBuilder",
".",
"beginControlFlow",
"(",
"\"try\"",
")",
";",
"methodBuilder",
".",
"addStat... | Generate populate.
@param schema
the schema
@param methodBuilder
the method builder
@param instance
the instance | [
"Generate",
"populate",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L693-L724 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generateOpen | private void generateOpen(String schemaName) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("open")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC).returns(className(schemaName));
methodBuilder.addJavadoc("Retrieve data source instance and open it.\n");
methodBuilder.addJavadoc("@return opened... | java | private void generateOpen(String schemaName) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("open")
.addModifiers(Modifier.PUBLIC, Modifier.STATIC).returns(className(schemaName));
methodBuilder.addJavadoc("Retrieve data source instance and open it.\n");
methodBuilder.addJavadoc("@return opened... | [
"private",
"void",
"generateOpen",
"(",
"String",
"schemaName",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"open\"",
")",
".",
"addModifiers",
"(",
"Modifier",
".",
"PUBLIC",
",",
"Modifier",
".",
"... | Generate open.
@param schemaName
the schema name | [
"Generate",
"open",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L732-L745 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.generateOnConfigure | private void generateOnConfigure(boolean useForeignKey) {
// onConfigure
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("onConfigure").addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC);
methodBuilder.addParameter(SQLiteDatabase.class, "database");
methodBuilder.addJavadoc("onConfigu... | java | private void generateOnConfigure(boolean useForeignKey) {
// onConfigure
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("onConfigure").addAnnotation(Override.class)
.addModifiers(Modifier.PUBLIC);
methodBuilder.addParameter(SQLiteDatabase.class, "database");
methodBuilder.addJavadoc("onConfigu... | [
"private",
"void",
"generateOnConfigure",
"(",
"boolean",
"useForeignKey",
")",
"{",
"// onConfigure",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"onConfigure\"",
")",
".",
"addAnnotation",
"(",
"Override",
".",
"c... | Generate on configure.
@param useForeignKey
the use foreign key | [
"Generate",
"on",
"configure",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L981-L999 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java | BindDataSourceBuilder.orderEntitiesList | public static List<SQLiteEntity> orderEntitiesList(SQLiteDatabaseSchema schema) {
List<SQLiteEntity> entities = schema.getEntitiesAsList();
Collections.sort(entities, new Comparator<SQLiteEntity>() {
@Override
public int compare(SQLiteEntity lhs, SQLiteEntity rhs) {
return lhs.getTableName().compareTo(rh... | java | public static List<SQLiteEntity> orderEntitiesList(SQLiteDatabaseSchema schema) {
List<SQLiteEntity> entities = schema.getEntitiesAsList();
Collections.sort(entities, new Comparator<SQLiteEntity>() {
@Override
public int compare(SQLiteEntity lhs, SQLiteEntity rhs) {
return lhs.getTableName().compareTo(rh... | [
"public",
"static",
"List",
"<",
"SQLiteEntity",
">",
"orderEntitiesList",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"List",
"<",
"SQLiteEntity",
">",
"entities",
"=",
"schema",
".",
"getEntitiesAsList",
"(",
")",
";",
"Collections",
".",
"sort",
"(",
"... | Generate ordered entities list.
@param schema
the schema
@return the list | [
"Generate",
"ordered",
"entities",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDataSourceBuilder.java#L1008-L1034 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.