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-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.addUnsignedShort | public void addUnsignedShort( int value ) {
if ( 2 + length < capacity ) {
DynamicByteBufferHelper.unsignedShortTo( buffer, length, value );
} else {
buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 2 );
capacity = buffer.length;
Dynami... | java | public void addUnsignedShort( int value ) {
if ( 2 + length < capacity ) {
DynamicByteBufferHelper.unsignedShortTo( buffer, length, value );
} else {
buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 2 );
capacity = buffer.length;
Dynami... | [
"public",
"void",
"addUnsignedShort",
"(",
"int",
"value",
")",
"{",
"if",
"(",
"2",
"+",
"length",
"<",
"capacity",
")",
"{",
"DynamicByteBufferHelper",
".",
"unsignedShortTo",
"(",
"buffer",
",",
"length",
",",
"value",
")",
";",
"}",
"else",
"{",
"buf... | Adds the unsigned short.
@param value the value | [
"Adds",
"the",
"unsigned",
"short",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L413-L427 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeLargeDoubleArray | public void writeLargeDoubleArray( double[] values ) {
int byteSize = values.length * 8 + 4;
this.add( values.length );
doWriteDoubleArray( values, byteSize );
} | java | public void writeLargeDoubleArray( double[] values ) {
int byteSize = values.length * 8 + 4;
this.add( values.length );
doWriteDoubleArray( values, byteSize );
} | [
"public",
"void",
"writeLargeDoubleArray",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"8",
"+",
"4",
";",
"this",
".",
"add",
"(",
"values",
".",
"length",
")",
";",
"doWriteDoubleArray",
"(",
"va... | Write large double array.
@param values the values | [
"Write",
"large",
"double",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L687-L693 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeLargeLongArray | public void writeLargeLongArray( long[] values ) {
int byteSize = values.length * 8 + 4;
this.add( values.length );
doWriteLongArray( values, byteSize );
} | java | public void writeLargeLongArray( long[] values ) {
int byteSize = values.length * 8 + 4;
this.add( values.length );
doWriteLongArray( values, byteSize );
} | [
"public",
"void",
"writeLargeLongArray",
"(",
"long",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"8",
"+",
"4",
";",
"this",
".",
"add",
"(",
"values",
".",
"length",
")",
";",
"doWriteLongArray",
"(",
"values",... | Write large long array.
@param values the values | [
"Write",
"large",
"long",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L723-L727 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeLargeString | public void writeLargeString( String s ) {
final byte[] bytes = DynamicByteBufferHelper.bytes( s );
this.add( bytes.length );
this.add( bytes );
} | java | public void writeLargeString( String s ) {
final byte[] bytes = DynamicByteBufferHelper.bytes( s );
this.add( bytes.length );
this.add( bytes );
} | [
"public",
"void",
"writeLargeString",
"(",
"String",
"s",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"DynamicByteBufferHelper",
".",
"bytes",
"(",
"s",
")",
";",
"this",
".",
"add",
"(",
"bytes",
".",
"length",
")",
";",
"this",
".",
"add",
"... | Write large string.
@param s the s | [
"Write",
"large",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L747-L751 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeMediumDoubleArray | public void writeMediumDoubleArray( double[] values ) {
int byteSize = values.length * 8 + 2;
this.addUnsignedShort( values.length );
doWriteDoubleArray( values, byteSize );
} | java | public void writeMediumDoubleArray( double[] values ) {
int byteSize = values.length * 8 + 2;
this.addUnsignedShort( values.length );
doWriteDoubleArray( values, byteSize );
} | [
"public",
"void",
"writeMediumDoubleArray",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"8",
"+",
"2",
";",
"this",
".",
"addUnsignedShort",
"(",
"values",
".",
"length",
")",
";",
"doWriteDoubleArray"... | Write medium double array.
@param values the values | [
"Write",
"medium",
"double",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L777-L782 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeMediumFloatArray | public void writeMediumFloatArray( float[] values ) {
int byteSize = values.length * 4 + 2;
this.addUnsignedShort( values.length );
doWriteFloatArray( values, byteSize );
} | java | public void writeMediumFloatArray( float[] values ) {
int byteSize = values.length * 4 + 2;
this.addUnsignedShort( values.length );
doWriteFloatArray( values, byteSize );
} | [
"public",
"void",
"writeMediumFloatArray",
"(",
"float",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"4",
"+",
"2",
";",
"this",
".",
"addUnsignedShort",
"(",
"values",
".",
"length",
")",
";",
"doWriteFloatArray",
... | Write medium float array.
@param values the values | [
"Write",
"medium",
"float",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L789-L794 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeMediumLongArray | public void writeMediumLongArray( long[] values ) {
int byteSize = values.length * 8 + 2;
this.addUnsignedShort( values.length );
doWriteLongArray( values, byteSize );
} | java | public void writeMediumLongArray( long[] values ) {
int byteSize = values.length * 8 + 2;
this.addUnsignedShort( values.length );
doWriteLongArray( values, byteSize );
} | [
"public",
"void",
"writeMediumLongArray",
"(",
"long",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"8",
"+",
"2",
";",
"this",
".",
"addUnsignedShort",
"(",
"values",
".",
"length",
")",
";",
"doWriteLongArray",
"(... | Write medium long array.
@param values the values | [
"Write",
"medium",
"long",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L812-L816 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeMediumShortArray | public void writeMediumShortArray( short[] values ) {
int byteSize = values.length * 2 + 2;
this.addUnsignedShort( values.length );
doWriteShortArray( values, byteSize );
} | java | public void writeMediumShortArray( short[] values ) {
int byteSize = values.length * 2 + 2;
this.addUnsignedShort( values.length );
doWriteShortArray( values, byteSize );
} | [
"public",
"void",
"writeMediumShortArray",
"(",
"short",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"2",
"+",
"2",
";",
"this",
".",
"addUnsignedShort",
"(",
"values",
".",
"length",
")",
";",
"doWriteShortArray",
... | Write medium short array.
@param values the values | [
"Write",
"medium",
"short",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L823-L827 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeMediumString | public void writeMediumString( String s ) {
final byte[] bytes = DynamicByteBufferHelper.bytes( s );
this.addUnsignedShort( bytes.length );
this.add( bytes );
} | java | public void writeMediumString( String s ) {
final byte[] bytes = DynamicByteBufferHelper.bytes( s );
this.addUnsignedShort( bytes.length );
this.add( bytes );
} | [
"public",
"void",
"writeMediumString",
"(",
"String",
"s",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"DynamicByteBufferHelper",
".",
"bytes",
"(",
"s",
")",
";",
"this",
".",
"addUnsignedShort",
"(",
"bytes",
".",
"length",
")",
";",
"this",
"."... | Write medium string.
@param s the s | [
"Write",
"medium",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L834-L838 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeSmallDoubleArray | public void writeSmallDoubleArray( double[] values ) {
int byteSize = values.length * 8 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteDoubleArray( values, byteSize );
} | java | public void writeSmallDoubleArray( double[] values ) {
int byteSize = values.length * 8 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteDoubleArray( values, byteSize );
} | [
"public",
"void",
"writeSmallDoubleArray",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"8",
"+",
"1",
";",
"this",
".",
"addUnsignedByte",
"(",
"(",
"short",
")",
"values",
".",
"length",
")",
";",... | Write small double array.
@param values the values | [
"Write",
"small",
"double",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L864-L869 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeSmallLongArray | public void writeSmallLongArray( long[] values ) {
int byteSize = values.length * 8 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteLongArray( values, byteSize );
} | java | public void writeSmallLongArray( long[] values ) {
int byteSize = values.length * 8 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteLongArray( values, byteSize );
} | [
"public",
"void",
"writeSmallLongArray",
"(",
"long",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"8",
"+",
"1",
";",
"this",
".",
"addUnsignedByte",
"(",
"(",
"short",
")",
"values",
".",
"length",
")",
";",
"... | Write small long array.
@param values the values | [
"Write",
"small",
"long",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L898-L902 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeSmallShortArray | public void writeSmallShortArray( short[] values ) {
int byteSize = values.length * 2 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteShortArray( values, byteSize );
} | java | public void writeSmallShortArray( short[] values ) {
int byteSize = values.length * 2 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteShortArray( values, byteSize );
} | [
"public",
"void",
"writeSmallShortArray",
"(",
"short",
"[",
"]",
"values",
")",
"{",
"int",
"byteSize",
"=",
"values",
".",
"length",
"*",
"2",
"+",
"1",
";",
"this",
".",
"addUnsignedByte",
"(",
"(",
"short",
")",
"values",
".",
"length",
")",
";",
... | Write small short array.
@param values the values | [
"Write",
"small",
"short",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L909-L913 | train |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java | DynamicByteBuffer.writeSmallString | public void writeSmallString( String s ) {
final byte[] bytes = DynamicByteBufferHelper.bytes( s );
this.addUnsignedByte( ( short ) bytes.length );
this.add( bytes );
} | java | public void writeSmallString( String s ) {
final byte[] bytes = DynamicByteBufferHelper.bytes( s );
this.addUnsignedByte( ( short ) bytes.length );
this.add( bytes );
} | [
"public",
"void",
"writeSmallString",
"(",
"String",
"s",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"DynamicByteBufferHelper",
".",
"bytes",
"(",
"s",
")",
";",
"this",
".",
"addUnsignedByte",
"(",
"(",
"short",
")",
"bytes",
".",
"length",
")",... | Write small string.
@param s the s | [
"Write",
"small",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBuffer.java#L920-L924 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/element/GeneratedTypeElement.java | GeneratedTypeElement.getQualifiedName | public String getQualifiedName() {
if (StringUtils.hasText(packageName)) {
return packageName + "." + typeSpec.name;
}
return typeSpec.name;
} | java | public String getQualifiedName() {
if (StringUtils.hasText(packageName)) {
return packageName + "." + typeSpec.name;
}
return typeSpec.name;
} | [
"public",
"String",
"getQualifiedName",
"(",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"packageName",
")",
")",
"{",
"return",
"packageName",
"+",
"\".\"",
"+",
"typeSpec",
".",
"name",
";",
"}",
"return",
"typeSpec",
".",
"name",
";",
"}"... | Gets the qualified name.
@return the qualified name | [
"Gets",
"the",
"qualified",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/element/GeneratedTypeElement.java#L90-L96 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/JavaWriterHelper.java | JavaWriterHelper.writeJava2File | public static void writeJava2File(Filer filer, String packageName, TypeSpec typeSpec) throws IOException {
JavaFile target = JavaFile.builder(packageName, typeSpec).skipJavaLangImports(true).build();
target.writeTo(filer);
} | java | public static void writeJava2File(Filer filer, String packageName, TypeSpec typeSpec) throws IOException {
JavaFile target = JavaFile.builder(packageName, typeSpec).skipJavaLangImports(true).build();
target.writeTo(filer);
} | [
"public",
"static",
"void",
"writeJava2File",
"(",
"Filer",
"filer",
",",
"String",
"packageName",
",",
"TypeSpec",
"typeSpec",
")",
"throws",
"IOException",
"{",
"JavaFile",
"target",
"=",
"JavaFile",
".",
"builder",
"(",
"packageName",
",",
"typeSpec",
")",
... | Write java 2 file.
@param filer the filer
@param packageName the package name
@param typeSpec the type spec
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"java",
"2",
"file",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/JavaWriterHelper.java#L28-L31 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoFactoryBuilder.java | BindDaoFactoryBuilder.generateDaoFactoryClassName | public static ClassName generateDaoFactoryClassName(SQLiteDatabaseSchema schema) {
String schemaName = buildDaoFactoryName(schema);
String packageName=TypeUtility.extractPackageName(schema.getElement());
return ClassName.get(packageName, schemaName);
} | java | public static ClassName generateDaoFactoryClassName(SQLiteDatabaseSchema schema) {
String schemaName = buildDaoFactoryName(schema);
String packageName=TypeUtility.extractPackageName(schema.getElement());
return ClassName.get(packageName, schemaName);
} | [
"public",
"static",
"ClassName",
"generateDaoFactoryClassName",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"String",
"schemaName",
"=",
"buildDaoFactoryName",
"(",
"schema",
")",
";",
"String",
"packageName",
"=",
"TypeUtility",
".",
"extractPackageName",
"(",
"... | Given a schema, generate its daoFactory name.
@param schema the schema
@return the string | [
"Given",
"a",
"schema",
"generate",
"its",
"daoFactory",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoFactoryBuilder.java#L79-L84 | train |
xcesco/kripton | kripton-android-core/src/main/java/com/abubusoft/kripton/android/KriptonLibrary.java | KriptonLibrary.init | public static void init(Context contextValue, ExecutorService service) {
context = contextValue;
if (service == null) {
executerService = Executors.newFixedThreadPool(THREAD_POOL_SIZE_DEFAULT);
} else {
executerService = service;
}
} | java | public static void init(Context contextValue, ExecutorService service) {
context = contextValue;
if (service == null) {
executerService = Executors.newFixedThreadPool(THREAD_POOL_SIZE_DEFAULT);
} else {
executerService = service;
}
} | [
"public",
"static",
"void",
"init",
"(",
"Context",
"contextValue",
",",
"ExecutorService",
"service",
")",
"{",
"context",
"=",
"contextValue",
";",
"if",
"(",
"service",
"==",
"null",
")",
"{",
"executerService",
"=",
"Executors",
".",
"newFixedThreadPool",
... | Method to invoke during application initialization.
@param contextValue
the context value
@param executorService
the executor service | [
"Method",
"to",
"invoke",
"during",
"application",
"initialization",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-android-core/src/main/java/com/abubusoft/kripton/android/KriptonLibrary.java#L77-L86 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindCursorBuilder.java | BindCursorBuilder.generateExecuteMethod | private MethodSpec.Builder generateExecuteMethod(String packageName, SQLiteEntity entity) {
ParameterizedTypeName parameterizedReturnTypeName = ParameterizedTypeName.get(className(ArrayList.class), className(packageName,entity.getSimpleName()));
//@formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.... | java | private MethodSpec.Builder generateExecuteMethod(String packageName, SQLiteEntity entity) {
ParameterizedTypeName parameterizedReturnTypeName = ParameterizedTypeName.get(className(ArrayList.class), className(packageName,entity.getSimpleName()));
//@formatter:off
MethodSpec.Builder methodBuilder = MethodSpec.... | [
"private",
"MethodSpec",
".",
"Builder",
"generateExecuteMethod",
"(",
"String",
"packageName",
",",
"SQLiteEntity",
"entity",
")",
"{",
"ParameterizedTypeName",
"parameterizedReturnTypeName",
"=",
"ParameterizedTypeName",
".",
"get",
"(",
"className",
"(",
"ArrayList",
... | Generate execute method.
@param packageName the package name
@param entity the entity
@return the method spec. builder | [
"Generate",
"execute",
"method",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindCursorBuilder.java#L197-L242 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractCollectionBindTransform.java | AbstractCollectionBindTransform.defineCollectionClass | protected Class<?> defineCollectionClass(ParameterizedTypeName collectionTypeName) {
if (collectionTypeName.rawType.toString().startsWith(collectionClazz.getCanonicalName())) {
return defaultClazz;
} else if (collectionTypeName.rawType.toString().startsWith(SortedMap.class.getCanonicalName())) {
return TreeMa... | java | protected Class<?> defineCollectionClass(ParameterizedTypeName collectionTypeName) {
if (collectionTypeName.rawType.toString().startsWith(collectionClazz.getCanonicalName())) {
return defaultClazz;
} else if (collectionTypeName.rawType.toString().startsWith(SortedMap.class.getCanonicalName())) {
return TreeMa... | [
"protected",
"Class",
"<",
"?",
">",
"defineCollectionClass",
"(",
"ParameterizedTypeName",
"collectionTypeName",
")",
"{",
"if",
"(",
"collectionTypeName",
".",
"rawType",
".",
"toString",
"(",
")",
".",
"startsWith",
"(",
"collectionClazz",
".",
"getCanonicalName"... | Define collection class.
@param collectionTypeName
the collection type name
@return the class | [
"Define",
"collection",
"class",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/AbstractCollectionBindTransform.java#L132-L146 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlUtility.java | SqlUtility.defineCollection | public static ClassName defineCollection(TypeName listClazzName) {
try {
Class<?> clazz=null;
if (listClazzName instanceof ParameterizedTypeName) {
ParameterizedTypeName returnListName = (ParameterizedTypeName) listClazzName;
clazz = Class.forName(returnListName.rawType.toString());
} else {
claz... | java | public static ClassName defineCollection(TypeName listClazzName) {
try {
Class<?> clazz=null;
if (listClazzName instanceof ParameterizedTypeName) {
ParameterizedTypeName returnListName = (ParameterizedTypeName) listClazzName;
clazz = Class.forName(returnListName.rawType.toString());
} else {
claz... | [
"public",
"static",
"ClassName",
"defineCollection",
"(",
"TypeName",
"listClazzName",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"null",
";",
"if",
"(",
"listClazzName",
"instanceof",
"ParameterizedTypeName",
")",
"{",
"ParameterizedTypeName",
... | Define collection.
@param listClazzName
the list clazz name
@return the type name | [
"Define",
"collection",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlUtility.java#L119-L143 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java | KriptonContentValues.putNull | public void putNull(String key) {
if (this.compiledStatement != null) {
compiledStatement.bindNull(compiledStatementBindIndex++);
} else if (values != null) {
values.putNull(key);
return;
}
names.add(key);
// values.putNull(key);
args.add(null);
valueType.add(ParamType.NULL);
} | java | public void putNull(String key) {
if (this.compiledStatement != null) {
compiledStatement.bindNull(compiledStatementBindIndex++);
} else if (values != null) {
values.putNull(key);
return;
}
names.add(key);
// values.putNull(key);
args.add(null);
valueType.add(ParamType.NULL);
} | [
"public",
"void",
"putNull",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"this",
".",
"compiledStatement",
"!=",
"null",
")",
"{",
"compiledStatement",
".",
"bindNull",
"(",
"compiledStatementBindIndex",
"++",
")",
";",
"}",
"else",
"if",
"(",
"values",
"!=... | Adds a null value to the set.
@param key
the name of the value to make null | [
"Adds",
"a",
"null",
"value",
"to",
"the",
"set",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java#L509-L521 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java | KriptonContentValues.addWhereArgs | public void addWhereArgs(String value) {
if (this.compiledStatement != null) {
compiledStatement.bindString(compiledStatementBindIndex++, value);
}
whereArgs.add(value);
valueType.add(ParamType.STRING);
} | java | public void addWhereArgs(String value) {
if (this.compiledStatement != null) {
compiledStatement.bindString(compiledStatementBindIndex++, value);
}
whereArgs.add(value);
valueType.add(ParamType.STRING);
} | [
"public",
"void",
"addWhereArgs",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"compiledStatement",
"!=",
"null",
")",
"{",
"compiledStatement",
".",
"bindString",
"(",
"compiledStatementBindIndex",
"++",
",",
"value",
")",
";",
"}",
"whereArgs",
... | Adds the where args.
@param value the value | [
"Adds",
"the",
"where",
"args",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java#L562-L569 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java | KriptonContentValues.clear | public void clear() {
names.clear();
values = null;
valueType.clear();
args.clear();
whereArgs.clear();
compiledStatement = null;
compiledStatementBindIndex = 1;
} | java | public void clear() {
names.clear();
values = null;
valueType.clear();
args.clear();
whereArgs.clear();
compiledStatement = null;
compiledStatementBindIndex = 1;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"names",
".",
"clear",
"(",
")",
";",
"values",
"=",
"null",
";",
"valueType",
".",
"clear",
"(",
")",
";",
"args",
".",
"clear",
"(",
")",
";",
"whereArgs",
".",
"clear",
"(",
")",
";",
"compiledStatement"... | Removes all values. | [
"Removes",
"all",
"values",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java#L644-L653 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java | KriptonContentValues.keyList | public String keyList() {
String separator = "";
StringBuilder buffer = new StringBuilder();
String item;
for (int i = 0; i < names.size(); i++) {
item = names.get(i);
buffer.append(separator + item);
separator = ", ";
}
return buffer.toString();
} | java | public String keyList() {
String separator = "";
StringBuilder buffer = new StringBuilder();
String item;
for (int i = 0; i < names.size(); i++) {
item = names.get(i);
buffer.append(separator + item);
separator = ", ";
}
return buffer.toString();
} | [
"public",
"String",
"keyList",
"(",
")",
"{",
"String",
"separator",
"=",
"\"\"",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"item",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"names",
".",
"size"... | Key list.
@return the string | [
"Key",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java#L689-L701 | train |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java | KriptonContentValues.keyValueList | public String keyValueList() {
String separator = "";
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < names.size(); i++) {
buffer.append(separator + "?");
separator = ", ";
}
return buffer.toString();
} | java | public String keyValueList() {
String separator = "";
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < names.size(); i++) {
buffer.append(separator + "?");
separator = ", ";
}
return buffer.toString();
} | [
"public",
"String",
"keyValueList",
"(",
")",
"{",
"String",
"separator",
"=",
"\"\"",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"names",
".",
"size",
"(",
")",
";",
... | Key value list.
@return the string | [
"Key",
"value",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonContentValues.java#L708-L718 | train |
xcesco/kripton | kripton-retrofit-converter/src/main/java/com/abubusoft/kripton/retrofit2/KriptonResponseBodyCollectionConverter.java | KriptonResponseBodyCollectionConverter.replaceInterface | private Class<?> replaceInterface(Class<?> clazz) {
if (clazz.equals(List.class)) {
return ArrayList.class;
}
if (clazz.equals(Set.class)) {
return HashSet.class;
}
if (clazz.equals(Map.class)) {
return HashMap.class;
}
return clazz;
} | java | private Class<?> replaceInterface(Class<?> clazz) {
if (clazz.equals(List.class)) {
return ArrayList.class;
}
if (clazz.equals(Set.class)) {
return HashSet.class;
}
if (clazz.equals(Map.class)) {
return HashMap.class;
}
return clazz;
} | [
"private",
"Class",
"<",
"?",
">",
"replaceInterface",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
".",
"equals",
"(",
"List",
".",
"class",
")",
")",
"{",
"return",
"ArrayList",
".",
"class",
";",
"}",
"if",
"(",
"clazz",
... | Replace interface.
@param clazz the clazz
@return the class | [
"Replace",
"interface",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-retrofit-converter/src/main/java/com/abubusoft/kripton/retrofit2/KriptonResponseBodyCollectionConverter.java#L69-L83 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.checkRelaxed | private void checkRelaxed(String errorMessage) {
if (!relaxed) {
throw new KriptonRuntimeException(errorMessage, true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
}
if (error == null) {
error = "Error: " + errorMessage;
}
} | java | private void checkRelaxed(String errorMessage) {
if (!relaxed) {
throw new KriptonRuntimeException(errorMessage, true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
}
if (error == null) {
error = "Error: " + errorMessage;
}
} | [
"private",
"void",
"checkRelaxed",
"(",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"!",
"relaxed",
")",
"{",
"throw",
"new",
"KriptonRuntimeException",
"(",
"errorMessage",
",",
"true",
",",
"this",
".",
"getLineNumber",
"(",
")",
",",
"this",
".",
"ge... | Check relaxed.
@param errorMessage the error message | [
"Check",
"relaxed",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L432-L439 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readUntil | private String readUntil(char[] delimiter, boolean returnText) throws IOException, KriptonRuntimeException {
int start = position;
StringBuilder result = null;
if (returnText && text != null) {
result = new StringBuilder();
result.append(text);
}
search: while (true) {
if (position + delimiter.leng... | java | private String readUntil(char[] delimiter, boolean returnText) throws IOException, KriptonRuntimeException {
int start = position;
StringBuilder result = null;
if (returnText && text != null) {
result = new StringBuilder();
result.append(text);
}
search: while (true) {
if (position + delimiter.leng... | [
"private",
"String",
"readUntil",
"(",
"char",
"[",
"]",
"delimiter",
",",
"boolean",
"returnText",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"int",
"start",
"=",
"position",
";",
"StringBuilder",
"result",
"=",
"null",
";",
"if",
"(",... | Reads text until the specified delimiter is encountered. Consumes the
text and the delimiter.
@param delimiter the delimiter
@param returnText true to return the read text excluding the delimiter; false to
return null.
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throw... | [
"Reads",
"text",
"until",
"the",
"specified",
"delimiter",
"is",
"encountered",
".",
"Consumes",
"the",
"text",
"and",
"the",
"delimiter",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L611-L660 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readXmlDeclaration | private void readXmlDeclaration() throws IOException, KriptonRuntimeException {
if (bufferStartLine != 0 || bufferStartColumn != 0 || position != 0) {
checkRelaxed("processing instructions must not start with xml");
}
read(START_PROCESSING_INSTRUCTION);
parseStartTag(true, true);
if (attributeCount < 1 |... | java | private void readXmlDeclaration() throws IOException, KriptonRuntimeException {
if (bufferStartLine != 0 || bufferStartColumn != 0 || position != 0) {
checkRelaxed("processing instructions must not start with xml");
}
read(START_PROCESSING_INSTRUCTION);
parseStartTag(true, true);
if (attributeCount < 1 |... | [
"private",
"void",
"readXmlDeclaration",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"if",
"(",
"bufferStartLine",
"!=",
"0",
"||",
"bufferStartColumn",
"!=",
"0",
"||",
"position",
"!=",
"0",
")",
"{",
"checkRelaxed",
"(",
"\"process... | Returns true if an XML declaration was read.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Returns",
"true",
"if",
"an",
"XML",
"declaration",
"was",
"read",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L668-L707 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readComment | private String readComment(boolean returnText) throws IOException, KriptonRuntimeException {
read(START_COMMENT);
if (relaxed) {
return readUntil(END_COMMENT, returnText);
}
String commentText = readUntil(COMMENT_DOUBLE_DASH, returnText);
if (peekCharacter() != '>') {
throw new KriptonRuntimeException... | java | private String readComment(boolean returnText) throws IOException, KriptonRuntimeException {
read(START_COMMENT);
if (relaxed) {
return readUntil(END_COMMENT, returnText);
}
String commentText = readUntil(COMMENT_DOUBLE_DASH, returnText);
if (peekCharacter() != '>') {
throw new KriptonRuntimeException... | [
"private",
"String",
"readComment",
"(",
"boolean",
"returnText",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"START_COMMENT",
")",
";",
"if",
"(",
"relaxed",
")",
"{",
"return",
"readUntil",
"(",
"END_COMMENT",
",",
"returnTe... | Read comment.
@param returnText the return text
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"comment",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L717-L730 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readInternalSubset | private void readInternalSubset() throws IOException, KriptonRuntimeException {
read('[');
while (true) {
skip();
if (peekCharacter() == ']') {
position++;
return;
}
int declarationType = peekType(true);
switch (declarationType) {
case ELEMENTDECL:
readElementDeclaration();
break... | java | private void readInternalSubset() throws IOException, KriptonRuntimeException {
read('[');
while (true) {
skip();
if (peekCharacter() == ']') {
position++;
return;
}
int declarationType = peekType(true);
switch (declarationType) {
case ELEMENTDECL:
readElementDeclaration();
break... | [
"private",
"void",
"readInternalSubset",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"'",
"'",
")",
";",
"while",
"(",
"true",
")",
"{",
"skip",
"(",
")",
";",
"if",
"(",
"peekCharacter",
"(",
")",
"==",
"'",
"'... | Read internal subset.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"internal",
"subset",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L853-L897 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readNotationDeclaration | private void readNotationDeclaration() throws IOException, KriptonRuntimeException {
read(START_NOTATION);
skip();
readName();
if (!readExternalId(false, false)) {
throw new KriptonRuntimeException("Expected external ID or public ID for notation", true, this.getLineNumber(), this.getColumnNumber(), getPositi... | java | private void readNotationDeclaration() throws IOException, KriptonRuntimeException {
read(START_NOTATION);
skip();
readName();
if (!readExternalId(false, false)) {
throw new KriptonRuntimeException("Expected external ID or public ID for notation", true, this.getLineNumber(), this.getColumnNumber(), getPositi... | [
"private",
"void",
"readNotationDeclaration",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"START_NOTATION",
")",
";",
"skip",
"(",
")",
";",
"readName",
"(",
")",
";",
"if",
"(",
"!",
"readExternalId",
"(",
"false",
"... | Read notation declaration.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"notation",
"declaration",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L1138-L1147 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readEndTag | private void readEndTag() throws IOException, KriptonRuntimeException {
read('<');
read('/');
name = readName(); // TODO: pass the expected name in as a hint?
skip();
read('>');
int sp = (depth - 1) * 4;
if (depth == 0) {
checkRelaxed("read end tag " + name + " with no tags open");
type = COMMENT;... | java | private void readEndTag() throws IOException, KriptonRuntimeException {
read('<');
read('/');
name = readName(); // TODO: pass the expected name in as a hint?
skip();
read('>');
int sp = (depth - 1) * 4;
if (depth == 0) {
checkRelaxed("read end tag " + name + " with no tags open");
type = COMMENT;... | [
"private",
"void",
"readEndTag",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"read",
"(",
"'",
"'",
")",
";",
"read",
"(",
"'",
"'",
")",
";",
"name",
"=",
"readName",
"(",
")",
";",
"// TODO: pass the expected name in as a hint?",
... | Read end tag.
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Read",
"end",
"tag",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L1155-L1177 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java | XMLParser.readName | private String readName() throws IOException, KriptonRuntimeException {
if (position >= limit && !fillBuffer(1)) {
checkRelaxed("name expected");
return "";
}
int start = position;
StringBuilder result = null;
// read the first character
char c = buffer[position];
if ((c >= 'a' && c <= 'z') || (c ... | java | private String readName() throws IOException, KriptonRuntimeException {
if (position >= limit && !fillBuffer(1)) {
checkRelaxed("name expected");
return "";
}
int start = position;
StringBuilder result = null;
// read the first character
char c = buffer[position];
if ((c >= 'a' && c <= 'z') || (c ... | [
"private",
"String",
"readName",
"(",
")",
"throws",
"IOException",
",",
"KriptonRuntimeException",
"{",
"if",
"(",
"position",
">=",
"limit",
"&&",
"!",
"fillBuffer",
"(",
"1",
")",
")",
"{",
"checkRelaxed",
"(",
"\"name expected\"",
")",
";",
"return",
"\"... | Returns an element or attribute name. This is always non-empty for
non-relaxed parsers.
@return the string
@throws IOException Signals that an I/O exception has occurred.
@throws KriptonRuntimeException the kripton runtime exception | [
"Returns",
"an",
"element",
"or",
"attribute",
"name",
".",
"This",
"is",
"always",
"non",
"-",
"empty",
"for",
"non",
"-",
"relaxed",
"parsers",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLParser.java#L1753-L1812 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelBucket.java | ModelBucket.get | public T get(String name) {
String lcName = name.toLowerCase();
for (T item : collection) {
if (item.getName().toLowerCase().equals(lcName)) {
return item;
}
}
return null;
} | java | public T get(String name) {
String lcName = name.toLowerCase();
for (T item : collection) {
if (item.getName().toLowerCase().equals(lcName)) {
return item;
}
}
return null;
} | [
"public",
"T",
"get",
"(",
"String",
"name",
")",
"{",
"String",
"lcName",
"=",
"name",
".",
"toLowerCase",
"(",
")",
";",
"for",
"(",
"T",
"item",
":",
"collection",
")",
"{",
"if",
"(",
"item",
".",
"getName",
"(",
")",
".",
"toLowerCase",
"(",
... | Find for contained element, using its name.
@param name the name
@return the t | [
"Find",
"for",
"contained",
"element",
"using",
"its",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelBucket.java#L48-L57 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.javaProperty2ContentValues | public static void javaProperty2ContentValues(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property) {
TypeName typeName = null;
if (property != null && property.getPropertyType() != null) {
typeName = property.getPropertyType().getTypeName();
}
if (property != nu... | java | public static void javaProperty2ContentValues(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property) {
TypeName typeName = null;
if (property != null && property.getPropertyType() != null) {
typeName = property.getPropertyType().getTypeName();
}
if (property != nu... | [
"public",
"static",
"void",
"javaProperty2ContentValues",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"ModelProperty",
"property",
")",
"{",
"TypeName",
"typeName",
"=",
"null",
";",
"if",
"(",
... | Used to convert a property of managed bean to contentValue.
@param methodBuilder
the method builder
@param beanClass
the bean class
@param beanName
the bean name
@param property
the property | [
"Used",
"to",
"convert",
"a",
"property",
"of",
"managed",
"bean",
"to",
"contentValue",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L102-L117 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.javaProperty2WhereCondition | public static void javaProperty2WhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
if (property != null && property.hasTypeAdapter()) {
methodBuilder.addCode(
AbstractSQLTransform.PRE_TYPE_ADAPTER_TO_STRING + "$L" + Abs... | java | public static void javaProperty2WhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
if (property != null && property.hasTypeAdapter()) {
methodBuilder.addCode(
AbstractSQLTransform.PRE_TYPE_ADAPTER_TO_STRING + "$L" + Abs... | [
"public",
"static",
"void",
"javaProperty2WhereCondition",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
",",
"TypeName",
"paramType",
",",
"ModelProperty",
"property",
")",
"{",
"if",
"(",
"prope... | Used to convert a property of managed bean to where condition.
@param methodBuilder
the method builder
@param method
the method
@param paramName
the param name
@param paramType
the param type
@param property
the property | [
"Used",
"to",
"convert",
"a",
"property",
"of",
"managed",
"bean",
"to",
"where",
"condition",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L133-L148 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.javaMethodParam2ContentValues | public static void javaMethodParam2ContentValues(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
AssertKripton.assertTrueOrInvalidMethodSignException(!method.hasAdapterForParam(paramName), method,
"method's parameter '%s' can not use a... | java | public static void javaMethodParam2ContentValues(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
AssertKripton.assertTrueOrInvalidMethodSignException(!method.hasAdapterForParam(paramName), method,
"method's parameter '%s' can not use a... | [
"public",
"static",
"void",
"javaMethodParam2ContentValues",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
",",
"TypeName",
"paramType",
",",
"ModelProperty",
"property",
")",
"{",
"AssertKripton",
... | Used to convert a method's parameter to contentValues. It can not have a
type adpter, because it eventually use the one define in associated
bean's attribute
@param methodBuilder
the method builder
@param method
the method
@param paramName
the param name
@param paramType
the param type
@param property
the property | [
"Used",
"to",
"convert",
"a",
"method",
"s",
"parameter",
"to",
"contentValues",
".",
"It",
"can",
"not",
"have",
"a",
"type",
"adpter",
"because",
"it",
"eventually",
"use",
"the",
"one",
"define",
"in",
"associated",
"bean",
"s",
"attribute"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L166-L177 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.isSupportedJDKType | public static boolean isSupportedJDKType(TypeName typeName) {
if (typeName.isPrimitive()) {
return getPrimitiveTransform(typeName) != null;
}
String name = typeName.toString();
if (name.startsWith("java.lang")) {
return getLanguageTransform(typeName) != null;
}
if (name.startsWith("java.util")) {
... | java | public static boolean isSupportedJDKType(TypeName typeName) {
if (typeName.isPrimitive()) {
return getPrimitiveTransform(typeName) != null;
}
String name = typeName.toString();
if (name.startsWith("java.lang")) {
return getLanguageTransform(typeName) != null;
}
if (name.startsWith("java.util")) {
... | [
"public",
"static",
"boolean",
"isSupportedJDKType",
"(",
"TypeName",
"typeName",
")",
"{",
"if",
"(",
"typeName",
".",
"isPrimitive",
"(",
")",
")",
"{",
"return",
"getPrimitiveTransform",
"(",
"typeName",
")",
"!=",
"null",
";",
"}",
"String",
"name",
"=",... | Checks if is supported JDK type.
@param typeName
the type name
@return true, if is supported JDK type | [
"Checks",
"if",
"is",
"supported",
"JDK",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L406-L434 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.resetBean | public static void resetBean(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property, String cursorName, String indexName) {
SQLTransform transform = lookup(property.getElement().asType());
if (transform == null) {
throw new IllegalArgumentException("Transform of " + pro... | java | public static void resetBean(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property, String cursorName, String indexName) {
SQLTransform transform = lookup(property.getElement().asType());
if (transform == null) {
throw new IllegalArgumentException("Transform of " + pro... | [
"public",
"static",
"void",
"resetBean",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"ModelProperty",
"property",
",",
"String",
"cursorName",
",",
"String",
"indexName",
")",
"{",
"SQLTransform... | Reset bean.
@param methodBuilder
the method builder
@param beanClass
the bean class
@param beanName
the bean name
@param property
the property
@param cursorName
the cursor name
@param indexName
the index name | [
"Reset",
"bean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L575-L584 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.columnTypeAsString | public static String columnTypeAsString(SQLProperty property) {
if (property.columnAffinityType != null && ColumnAffinityType.AUTO != property.columnAffinityType) {
return property.columnAffinityType.toString();
}
TypeName typeName = property.getPropertyType().getTypeName();
if (property.hasTypeAdapter()) {... | java | public static String columnTypeAsString(SQLProperty property) {
if (property.columnAffinityType != null && ColumnAffinityType.AUTO != property.columnAffinityType) {
return property.columnAffinityType.toString();
}
TypeName typeName = property.getPropertyType().getTypeName();
if (property.hasTypeAdapter()) {... | [
"public",
"static",
"String",
"columnTypeAsString",
"(",
"SQLProperty",
"property",
")",
"{",
"if",
"(",
"property",
".",
"columnAffinityType",
"!=",
"null",
"&&",
"ColumnAffinityType",
".",
"AUTO",
"!=",
"property",
".",
"columnAffinityType",
")",
"{",
"return",
... | Detect column type. If column affinity is specified by annotation,
affinity column is used.
@param property
the property
@return the SQlite column type as string | [
"Detect",
"column",
"type",
".",
"If",
"column",
"affinity",
"is",
"specified",
"by",
"annotation",
"affinity",
"column",
"is",
"used",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L594-L611 | train |
xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/core/internal/FastSafeIterableMap.java | FastSafeIterableMap.ceil | public Map.Entry<K, V> ceil(K k) {
if (contains(k)) {
return mHashMap.get(k).mPrevious;
}
return null;
} | java | public Map.Entry<K, V> ceil(K k) {
if (contains(k)) {
return mHashMap.get(k).mPrevious;
}
return null;
} | [
"public",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"ceil",
"(",
"K",
"k",
")",
"{",
"if",
"(",
"contains",
"(",
"k",
")",
")",
"{",
"return",
"mHashMap",
".",
"get",
"(",
"k",
")",
".",
"mPrevious",
";",
"}",
"return",
"null",
";",
"}"
] | Return an entry added to prior to an entry associated with the given key.
@param k the key
@return the map. entry | [
"Return",
"an",
"entry",
"added",
"to",
"prior",
"to",
"an",
"entry",
"associated",
"with",
"the",
"given",
"key",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/core/internal/FastSafeIterableMap.java#L88-L93 | train |
xcesco/kripton | kripton-shared-preferences/src/main/java/com/abubusoft/kripton/common/PrefsTypeAdapterUtils.java | PrefsTypeAdapterUtils.toJava | public static <D, J> J toJava(Class<? extends PreferenceTypeAdapter<J, D>> clazz, D value) {
@SuppressWarnings("unchecked")
PreferenceTypeAdapter<J, D> adapter = cache.get(clazz);
if (adapter == null) {
adapter = generateAdapter(clazz);
}
return adapter.toJava(value);
} | java | public static <D, J> J toJava(Class<? extends PreferenceTypeAdapter<J, D>> clazz, D value) {
@SuppressWarnings("unchecked")
PreferenceTypeAdapter<J, D> adapter = cache.get(clazz);
if (adapter == null) {
adapter = generateAdapter(clazz);
}
return adapter.toJava(value);
} | [
"public",
"static",
"<",
"D",
",",
"J",
">",
"J",
"toJava",
"(",
"Class",
"<",
"?",
"extends",
"PreferenceTypeAdapter",
"<",
"J",
",",
"D",
">",
">",
"clazz",
",",
"D",
"value",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"PreferenceT... | To java.
@param <D> the generic type
@param <J> the generic type
@param clazz the clazz
@param value the value
@return the j | [
"To",
"java",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-shared-preferences/src/main/java/com/abubusoft/kripton/common/PrefsTypeAdapterUtils.java#L46-L55 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/transform/SetPrefsTransformation.java | SetPrefsTransformation.isStringSet | public static boolean isStringSet(PrefsProperty property) {
boolean isStringSet = false;
TypeName typeName;
if (property.hasTypeAdapter()) {
typeName = TypeUtility.typeName(property.typeAdapter.dataType);
} else {
typeName = TypeUtility.typeName(property.getElement().asType());
}
// it is parameteri... | java | public static boolean isStringSet(PrefsProperty property) {
boolean isStringSet = false;
TypeName typeName;
if (property.hasTypeAdapter()) {
typeName = TypeUtility.typeName(property.typeAdapter.dataType);
} else {
typeName = TypeUtility.typeName(property.getElement().asType());
}
// it is parameteri... | [
"public",
"static",
"boolean",
"isStringSet",
"(",
"PrefsProperty",
"property",
")",
"{",
"boolean",
"isStringSet",
"=",
"false",
";",
"TypeName",
"typeName",
";",
"if",
"(",
"property",
".",
"hasTypeAdapter",
"(",
")",
")",
"{",
"typeName",
"=",
"TypeUtility"... | Checks if is string set.
@param property the property
@return true, if is string set | [
"Checks",
"if",
"is",
"string",
"set",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/transform/SetPrefsTransformation.java#L192-L212 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java | ModelAnnotation.getAttributeAsClassName | public String getAttributeAsClassName(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
if (StringUtils.hasText(temp)) {
temp = temp.replace(".class", "");
}
return temp;
} | java | public String getAttributeAsClassName(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
if (StringUtils.hasText(temp)) {
temp = temp.replace(".class", "");
}
return temp;
} | [
"public",
"String",
"getAttributeAsClassName",
"(",
"AnnotationAttributeType",
"attribute",
")",
"{",
"String",
"temp",
"=",
"attributes",
".",
"get",
"(",
"attribute",
".",
"getValue",
"(",
")",
")",
";",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"temp",... | Gets the attribute as class name.
@param attribute the attribute
@return the attribute as class name | [
"Gets",
"the",
"attribute",
"as",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java#L90-L98 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java | ModelAnnotation.getAttributeAsArray | public List<String> getAttributeAsArray(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return AnnotationUtility.extractAsArrayOfString(temp);
} | java | public List<String> getAttributeAsArray(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return AnnotationUtility.extractAsArrayOfString(temp);
} | [
"public",
"List",
"<",
"String",
">",
"getAttributeAsArray",
"(",
"AnnotationAttributeType",
"attribute",
")",
"{",
"String",
"temp",
"=",
"attributes",
".",
"get",
"(",
"attribute",
".",
"getValue",
"(",
")",
")",
";",
"return",
"AnnotationUtility",
".",
"ext... | Gets the attribute as array.
@param attribute the attribute
@return the attribute as array | [
"Gets",
"the",
"attribute",
"as",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java#L118-L122 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java | ModelAnnotation.getAttributeAsInt | public int getAttributeAsInt(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return Integer.parseInt(temp);
} | java | public int getAttributeAsInt(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return Integer.parseInt(temp);
} | [
"public",
"int",
"getAttributeAsInt",
"(",
"AnnotationAttributeType",
"attribute",
")",
"{",
"String",
"temp",
"=",
"attributes",
".",
"get",
"(",
"attribute",
".",
"getValue",
"(",
")",
")",
";",
"return",
"Integer",
".",
"parseInt",
"(",
"temp",
")",
";",
... | Gets the attribute as int.
@param attribute the attribute
@return the attribute as int | [
"Gets",
"the",
"attribute",
"as",
"int",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java#L130-L134 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateSubQueries | protected void generateSubQueries(Builder methodBuilder, SQLiteModelMethod method) {
SQLiteEntity entity = method.getEntity();
for (Triple<String, String, SQLiteModelMethod> item : method.childrenSelects) {
TypeName entityTypeName = TypeUtility.typeName(entity.getElement());
String setter;
if (entity.isIm... | java | protected void generateSubQueries(Builder methodBuilder, SQLiteModelMethod method) {
SQLiteEntity entity = method.getEntity();
for (Triple<String, String, SQLiteModelMethod> item : method.childrenSelects) {
TypeName entityTypeName = TypeUtility.typeName(entity.getElement());
String setter;
if (entity.isIm... | [
"protected",
"void",
"generateSubQueries",
"(",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
")",
"{",
"SQLiteEntity",
"entity",
"=",
"method",
".",
"getEntity",
"(",
")",
";",
"for",
"(",
"Triple",
"<",
"String",
",",
"String",
",",
"SQLite... | generate code for sub queries
@param methodBuilder
@param method | [
"generate",
"code",
"for",
"sub",
"queries"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L89-L110 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateCommonPart | public void generateCommonPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder, Set<JQLProjection> fieldList, boolean generateSqlField) {
generateCommonPart(method, classBuilder, methodBuilder, fieldList, GenerationType.ALL, null, generateSqlField, false);
} | java | public void generateCommonPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder, Set<JQLProjection> fieldList, boolean generateSqlField) {
generateCommonPart(method, classBuilder, methodBuilder, fieldList, GenerationType.ALL, null, generateSqlField, false);
} | [
"public",
"void",
"generateCommonPart",
"(",
"SQLiteModelMethod",
"method",
",",
"TypeSpec",
".",
"Builder",
"classBuilder",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"Set",
"<",
"JQLProjection",
">",
"fieldList",
",",
"boolean",
"generateSqlField",
"... | Generate common part.
@param method
the method
@param classBuilder
the class builder
@param methodBuilder
the method builder
@param fieldList
the field list
@param mapFields
the map fields | [
"Generate",
"common",
"part",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L324-L326 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateMethodBuilder | protected MethodSpec.Builder generateMethodBuilder(SQLiteModelMethod method) {
MethodSpec.Builder methodBuilder;
if (method.hasLiveData()) {
methodBuilder = MethodSpec.methodBuilder(method.getName() + LIVE_DATA_PREFIX).addModifiers(Modifier.PROTECTED);
} else {
methodBuilder = MethodSpec.methodBuilder(metho... | java | protected MethodSpec.Builder generateMethodBuilder(SQLiteModelMethod method) {
MethodSpec.Builder methodBuilder;
if (method.hasLiveData()) {
methodBuilder = MethodSpec.methodBuilder(method.getName() + LIVE_DATA_PREFIX).addModifiers(Modifier.PROTECTED);
} else {
methodBuilder = MethodSpec.methodBuilder(metho... | [
"protected",
"MethodSpec",
".",
"Builder",
"generateMethodBuilder",
"(",
"SQLiteModelMethod",
"method",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
";",
"if",
"(",
"method",
".",
"hasLiveData",
"(",
")",
")",
"{",
"methodBuilder",
"=",
"MethodSpec",
... | Generate method builder.
@param method
the method
@return the method spec. builder | [
"Generate",
"method",
"builder",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L701-L710 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateMethodSignature | protected void generateMethodSignature(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, TypeName returnTypeName, ParameterSpec... additionalParameterSpec) {
boolean finalParameter = false;
if (method.hasLiveData() && returnTypeName.equals(method.liveDataReturnClass)) {
finalParameter = true;
}
//... | java | protected void generateMethodSignature(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, TypeName returnTypeName, ParameterSpec... additionalParameterSpec) {
boolean finalParameter = false;
if (method.hasLiveData() && returnTypeName.equals(method.liveDataReturnClass)) {
finalParameter = true;
}
//... | [
"protected",
"void",
"generateMethodSignature",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"returnTypeName",
",",
"ParameterSpec",
"...",
"additionalParameterSpec",
")",
"{",
"boolean",
"finalParameter",
"=",
... | Generate method signature.
@param method
the method
@param methodBuilder
the method builder
@param returnTypeName
the return type name
@param additionalParameterSpec
the additional parameter spec | [
"Generate",
"method",
"signature",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L724-L748 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.checkUnusedParameters | public static void checkUnusedParameters(SQLiteModelMethod method, Set<String> usedMethodParameters, TypeName excludedClasses) {
int paramsCount = method.getParameters().size();
int usedCount = usedMethodParameters.size();
if (paramsCount > usedCount) {
StringBuilder sb = new StringBuilder();
String separa... | java | public static void checkUnusedParameters(SQLiteModelMethod method, Set<String> usedMethodParameters, TypeName excludedClasses) {
int paramsCount = method.getParameters().size();
int usedCount = usedMethodParameters.size();
if (paramsCount > usedCount) {
StringBuilder sb = new StringBuilder();
String separa... | [
"public",
"static",
"void",
"checkUnusedParameters",
"(",
"SQLiteModelMethod",
"method",
",",
"Set",
"<",
"String",
">",
"usedMethodParameters",
",",
"TypeName",
"excludedClasses",
")",
"{",
"int",
"paramsCount",
"=",
"method",
".",
"getParameters",
"(",
")",
".",... | Check if there are unused method parameters. In this case an exception
was throws.
@param method
the method
@param usedMethodParameters
the used method parameters
@param excludedClasses
the excluded classes | [
"Check",
"if",
"there",
"are",
"unused",
"method",
"parameters",
".",
"In",
"this",
"case",
"an",
"exception",
"was",
"throws",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L789-L811 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateSQLBuild | private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) {
methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class);
methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim());
SqlMod... | java | private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) {
methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class);
methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim());
SqlMod... | [
"private",
"static",
"void",
"generateSQLBuild",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SplittedSql",
"splittedSql",
",",
"boolean",
"countQuery",
")",
"{",
"methodBuilder",
".",
"addStatement",
"(",
"\"$T _sqlBui... | Generate SQL build.
@param method
the method
@param methodBuilder
the method builder
@param splittedSql
the splitted sql
@param countQuery
is true, the query manage the count query for paged result | [
"Generate",
"SQL",
"build",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L825-L837 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/model/many2many/M2MEntity.java | M2MEntity.extractClassName | public static String extractClassName(String fullName) {
int l = fullName.lastIndexOf(".");
return fullName.substring(l + 1);
} | java | public static String extractClassName(String fullName) {
int l = fullName.lastIndexOf(".");
return fullName.substring(l + 1);
} | [
"public",
"static",
"String",
"extractClassName",
"(",
"String",
"fullName",
")",
"{",
"int",
"l",
"=",
"fullName",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"return",
"fullName",
".",
"substring",
"(",
"l",
"+",
"1",
")",
";",
"}"
] | Extract class name.
@param fullName the full name
@return the string | [
"Extract",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/model/many2many/M2MEntity.java#L123-L127 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isTypeIncludedIn | public static boolean isTypeIncludedIn(TypeName value, Type... types) {
for (Type item : types) {
if (value.equals(typeName(item))) {
return true;
}
}
return false;
} | java | public static boolean isTypeIncludedIn(TypeName value, Type... types) {
for (Type item : types) {
if (value.equals(typeName(item))) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isTypeIncludedIn",
"(",
"TypeName",
"value",
",",
"Type",
"...",
"types",
")",
"{",
"for",
"(",
"Type",
"item",
":",
"types",
")",
"{",
"if",
"(",
"value",
".",
"equals",
"(",
"typeName",
"(",
"item",
")",
")",
")",
"{... | Checks if is type included in.
@param value
the value
@param types
the types
@return true, if is type included in | [
"Checks",
"if",
"is",
"type",
"included",
"in",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L64-L72 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isTypePrimitive | public static boolean isTypePrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.TYPE, Character.TYPE, Boolean.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE,
Float.TYPE, Double.TYPE);
} | java | public static boolean isTypePrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.TYPE, Character.TYPE, Boolean.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE,
Float.TYPE, Double.TYPE);
} | [
"public",
"static",
"boolean",
"isTypePrimitive",
"(",
"TypeName",
"value",
")",
"{",
"return",
"isTypeIncludedIn",
"(",
"value",
",",
"Byte",
".",
"TYPE",
",",
"Character",
".",
"TYPE",
",",
"Boolean",
".",
"TYPE",
",",
"Short",
".",
"TYPE",
",",
"Integer... | Checks if is type primitive.
@param value
the value
@return true, if is type primitive | [
"Checks",
"if",
"is",
"type",
"primitive",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L94-L97 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isTypeWrappedPrimitive | public static boolean isTypeWrappedPrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.class, Character.class, Boolean.class, Short.class, Integer.class,
Long.class, Float.class, Double.class);
} | java | public static boolean isTypeWrappedPrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.class, Character.class, Boolean.class, Short.class, Integer.class,
Long.class, Float.class, Double.class);
} | [
"public",
"static",
"boolean",
"isTypeWrappedPrimitive",
"(",
"TypeName",
"value",
")",
"{",
"return",
"isTypeIncludedIn",
"(",
"value",
",",
"Byte",
".",
"class",
",",
"Character",
".",
"class",
",",
"Boolean",
".",
"class",
",",
"Short",
".",
"class",
",",... | Checks if is type wrapped primitive.
@param value
the value
@return true, if is type wrapped primitive | [
"Checks",
"if",
"is",
"type",
"wrapped",
"primitive",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L106-L109 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isEquals | public static boolean isEquals(TypeName value, TypeName kindOfParameter) {
return value.toString().equals(kindOfParameter.toString());
} | java | public static boolean isEquals(TypeName value, TypeName kindOfParameter) {
return value.toString().equals(kindOfParameter.toString());
} | [
"public",
"static",
"boolean",
"isEquals",
"(",
"TypeName",
"value",
",",
"TypeName",
"kindOfParameter",
")",
"{",
"return",
"value",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"kindOfParameter",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Check if class that is rapresented by value has same typeName of entity parameter.
@param value
the value
@param kindOfParameter
the kind of parameter
@return true if value is equals to className. | [
"Check",
"if",
"class",
"that",
"is",
"rapresented",
"by",
"value",
"has",
"same",
"typeName",
"of",
"entity",
"parameter",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L179-L181 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.typeName | public static TypeName typeName(TypeMirror typeMirror) {
LiteralType literalType = LiteralType.of(typeMirror.toString());
if (literalType.isArray()) {
return ArrayTypeName.of(typeName(literalType.getRawType()));
} else if (literalType.isCollection()) {
return ParameterizedTypeName.get(TypeUtility.className... | java | public static TypeName typeName(TypeMirror typeMirror) {
LiteralType literalType = LiteralType.of(typeMirror.toString());
if (literalType.isArray()) {
return ArrayTypeName.of(typeName(literalType.getRawType()));
} else if (literalType.isCollection()) {
return ParameterizedTypeName.get(TypeUtility.className... | [
"public",
"static",
"TypeName",
"typeName",
"(",
"TypeMirror",
"typeMirror",
")",
"{",
"LiteralType",
"literalType",
"=",
"LiteralType",
".",
"of",
"(",
"typeMirror",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"literalType",
".",
"isArray",
"(",
")",
... | Convert a TypeMirror in a typeName.
@param typeMirror
the type mirror
@return typeName | [
"Convert",
"a",
"TypeMirror",
"in",
"a",
"typeName",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L243-L263 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.mergeTypeNameWithSuffix | public static ClassName mergeTypeNameWithSuffix(TypeName typeName, String typeNameSuffix) {
ClassName className = className(typeName.toString());
return classNameWithSuffix(className.packageName(), className.simpleName(), typeNameSuffix);
} | java | public static ClassName mergeTypeNameWithSuffix(TypeName typeName, String typeNameSuffix) {
ClassName className = className(typeName.toString());
return classNameWithSuffix(className.packageName(), className.simpleName(), typeNameSuffix);
} | [
"public",
"static",
"ClassName",
"mergeTypeNameWithSuffix",
"(",
"TypeName",
"typeName",
",",
"String",
"typeNameSuffix",
")",
"{",
"ClassName",
"className",
"=",
"className",
"(",
"typeName",
".",
"toString",
"(",
")",
")",
";",
"return",
"classNameWithSuffix",
"... | Merge type name with suffix.
@param typeName
the type name
@param typeNameSuffix
the type name suffix
@return the class name | [
"Merge",
"type",
"name",
"with",
"suffix",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L287-L291 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.typeName | public static TypeName typeName(String typeName) {
TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };
for (TypeName item : values) {
if (item.toString().equals(typeName)) {
return item;
}... | java | public static TypeName typeName(String typeName) {
TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };
for (TypeName item : values) {
if (item.toString().equals(typeName)) {
return item;
}... | [
"public",
"static",
"TypeName",
"typeName",
"(",
"String",
"typeName",
")",
"{",
"TypeName",
"[",
"]",
"values",
"=",
"{",
"TypeName",
".",
"BOOLEAN",
",",
"TypeName",
".",
"BYTE",
",",
"TypeName",
".",
"CHAR",
",",
"TypeName",
".",
"DOUBLE",
",",
"TypeN... | Convert a TypeMirror in a typeName, or classname or whatever.
@param typeName
the type name
@return typeName | [
"Convert",
"a",
"TypeMirror",
"in",
"a",
"typeName",
"or",
"classname",
"or",
"whatever",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L300-L320 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.checkTypeCompatibility | public static void checkTypeCompatibility(SQLiteModelMethod method, Pair<String, TypeName> item,
ModelProperty property) {
if (!TypeUtility.isEquals(item.value1, property.getPropertyType().getTypeName())) {
// ASSERT: property is not nullable but method yes, so we throw an
// exception
throw (new InvalidM... | java | public static void checkTypeCompatibility(SQLiteModelMethod method, Pair<String, TypeName> item,
ModelProperty property) {
if (!TypeUtility.isEquals(item.value1, property.getPropertyType().getTypeName())) {
// ASSERT: property is not nullable but method yes, so we throw an
// exception
throw (new InvalidM... | [
"public",
"static",
"void",
"checkTypeCompatibility",
"(",
"SQLiteModelMethod",
"method",
",",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
",",
"ModelProperty",
"property",
")",
"{",
"if",
"(",
"!",
"TypeUtility",
".",
"isEquals",
"(",
"item",
".",
... | Check if type if compatibility.
@param method
the method
@param item
the item
@param property
the property | [
"Check",
"if",
"type",
"if",
"compatibility",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L355-L366 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.beginStringConversion | public static void beginStringConversion(Builder methodBuilder, ModelProperty property) {
TypeName modelType = typeName(property.getElement().asType());
beginStringConversion(methodBuilder, modelType);
} | java | public static void beginStringConversion(Builder methodBuilder, ModelProperty property) {
TypeName modelType = typeName(property.getElement().asType());
beginStringConversion(methodBuilder, modelType);
} | [
"public",
"static",
"void",
"beginStringConversion",
"(",
"Builder",
"methodBuilder",
",",
"ModelProperty",
"property",
")",
"{",
"TypeName",
"modelType",
"=",
"typeName",
"(",
"property",
".",
"getElement",
"(",
")",
".",
"asType",
"(",
")",
")",
";",
"beginS... | generate begin string to translate in code to used in content value or parameter need to be converted in string through String.valueOf
@param methodBuilder
the method builder
@param property
the property | [
"generate",
"begin",
"string",
"to",
"translate",
"in",
"code",
"to",
"used",
"in",
"content",
"value",
"or",
"parameter",
"need",
"to",
"be",
"converted",
"in",
"string",
"through",
"String",
".",
"valueOf"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L376-L380 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.endStringConversion | public static void endStringConversion(Builder methodBuilder, TypeName typeMirror) {
SQLTransform transform = SQLTransformer.lookup(typeMirror);
switch (transform.getColumnType()) {
case TEXT:
return;
case BLOB:
methodBuilder.addCode(",$T.UTF_8)", StandardCharsets.class);
break;
case INTEGER:
case... | java | public static void endStringConversion(Builder methodBuilder, TypeName typeMirror) {
SQLTransform transform = SQLTransformer.lookup(typeMirror);
switch (transform.getColumnType()) {
case TEXT:
return;
case BLOB:
methodBuilder.addCode(",$T.UTF_8)", StandardCharsets.class);
break;
case INTEGER:
case... | [
"public",
"static",
"void",
"endStringConversion",
"(",
"Builder",
"methodBuilder",
",",
"TypeName",
"typeMirror",
")",
"{",
"SQLTransform",
"transform",
"=",
"SQLTransformer",
".",
"lookup",
"(",
"typeMirror",
")",
";",
"switch",
"(",
"transform",
".",
"getColumn... | generate end string to translate in code to used in content value or parameter need to be converted in string through String.valueOf
@param methodBuilder
the method builder
@param typeMirror
the type mirror | [
"generate",
"end",
"string",
"to",
"translate",
"in",
"code",
"to",
"used",
"in",
"content",
"value",
"or",
"parameter",
"need",
"to",
"be",
"converted",
"in",
"string",
"through",
"String",
".",
"valueOf"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L431-L447 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.typeName | public static TypeName typeName(TypeElement element, String suffix) {
String fullName = element.getQualifiedName().toString() + suffix;
int lastIndex = fullName.lastIndexOf(".");
String packageName = fullName.substring(0, lastIndex);
String className = fullName.substring(lastIndex + 1);
return typeName(pac... | java | public static TypeName typeName(TypeElement element, String suffix) {
String fullName = element.getQualifiedName().toString() + suffix;
int lastIndex = fullName.lastIndexOf(".");
String packageName = fullName.substring(0, lastIndex);
String className = fullName.substring(lastIndex + 1);
return typeName(pac... | [
"public",
"static",
"TypeName",
"typeName",
"(",
"TypeElement",
"element",
",",
"String",
"suffix",
")",
"{",
"String",
"fullName",
"=",
"element",
".",
"getQualifiedName",
"(",
")",
".",
"toString",
"(",
")",
"+",
"suffix",
";",
"int",
"lastIndex",
"=",
"... | Type name.
@param element
the element
@param suffix
the suffix
@return the type name | [
"Type",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L488-L497 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.parameterizedTypeName | public static TypeName parameterizedTypeName(ClassName rawClass, TypeName paramClass) {
return ParameterizedTypeName.get(rawClass, paramClass);
} | java | public static TypeName parameterizedTypeName(ClassName rawClass, TypeName paramClass) {
return ParameterizedTypeName.get(rawClass, paramClass);
} | [
"public",
"static",
"TypeName",
"parameterizedTypeName",
"(",
"ClassName",
"rawClass",
",",
"TypeName",
"paramClass",
")",
"{",
"return",
"ParameterizedTypeName",
".",
"get",
"(",
"rawClass",
",",
"paramClass",
")",
";",
"}"
] | Parameterized type name.
@param rawClass
the raw class
@param paramClass
the param class
@return the type name | [
"Parameterized",
"type",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L521-L523 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.simpleName | public static String simpleName(TypeName clazzName) {
String clazz = clazzName.toString();
int index = clazz.lastIndexOf(".");
if (index > 0) {
clazz=clazz.substring(index + 1);
}
return clazz;
} | java | public static String simpleName(TypeName clazzName) {
String clazz = clazzName.toString();
int index = clazz.lastIndexOf(".");
if (index > 0) {
clazz=clazz.substring(index + 1);
}
return clazz;
} | [
"public",
"static",
"String",
"simpleName",
"(",
"TypeName",
"clazzName",
")",
"{",
"String",
"clazz",
"=",
"clazzName",
".",
"toString",
"(",
")",
";",
"int",
"index",
"=",
"clazz",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"if",
"(",
"index",
">",
... | Return simple typeName of class.
@param clazzName
the clazz name
@return the string | [
"Return",
"simple",
"typeName",
"of",
"class",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L532-L539 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isEnum | public static boolean isEnum(String className) {
try {
// is it an enum?
TypeElement element = BindTypeSubProcessor.elementUtils.getTypeElement(className);
if (element instanceof TypeElement) {
TypeElement typeElement = element;
TypeMirror superclass = typeElement.getSuperclass();
if (superclass ... | java | public static boolean isEnum(String className) {
try {
// is it an enum?
TypeElement element = BindTypeSubProcessor.elementUtils.getTypeElement(className);
if (element instanceof TypeElement) {
TypeElement typeElement = element;
TypeMirror superclass = typeElement.getSuperclass();
if (superclass ... | [
"public",
"static",
"boolean",
"isEnum",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"// is it an enum?",
"TypeElement",
"element",
"=",
"BindTypeSubProcessor",
".",
"elementUtils",
".",
"getTypeElement",
"(",
"className",
")",
";",
"if",
"(",
"element",
"... | Checks if is enum.
@param className
the class name
@return true, if is enum | [
"Checks",
"if",
"is",
"enum",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L573-L592 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isCollectionOfType | public static boolean isCollectionOfType(TypeName typeName, TypeName elementTypeName) {
return isAssignable(typeName, Collection.class)
&& isEquals(((ParameterizedTypeName) typeName).typeArguments.get(0), elementTypeName);
} | java | public static boolean isCollectionOfType(TypeName typeName, TypeName elementTypeName) {
return isAssignable(typeName, Collection.class)
&& isEquals(((ParameterizedTypeName) typeName).typeArguments.get(0), elementTypeName);
} | [
"public",
"static",
"boolean",
"isCollectionOfType",
"(",
"TypeName",
"typeName",
",",
"TypeName",
"elementTypeName",
")",
"{",
"return",
"isAssignable",
"(",
"typeName",
",",
"Collection",
".",
"class",
")",
"&&",
"isEquals",
"(",
"(",
"(",
"ParameterizedTypeName... | Checks if is collection and if element type is the one passed as parameter.
@param typeName
the type name
@param elementTypeName
the element type name
@return true, if is collection | [
"Checks",
"if",
"is",
"collection",
"and",
"if",
"element",
"type",
"is",
"the",
"one",
"passed",
"as",
"parameter",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L697-L700 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isAssignable | public static boolean isAssignable(TypeName typeName, Class<?> assignableClazz) {
try {
if (typeName instanceof ParameterizedTypeName) {
typeName = ((ParameterizedTypeName) typeName).rawType;
} else if (typeName instanceof ArrayTypeName) {
typeName = ((ArrayTypeName) typeName).componentType;
}
Cl... | java | public static boolean isAssignable(TypeName typeName, Class<?> assignableClazz) {
try {
if (typeName instanceof ParameterizedTypeName) {
typeName = ((ParameterizedTypeName) typeName).rawType;
} else if (typeName instanceof ArrayTypeName) {
typeName = ((ArrayTypeName) typeName).componentType;
}
Cl... | [
"public",
"static",
"boolean",
"isAssignable",
"(",
"TypeName",
"typeName",
",",
"Class",
"<",
"?",
">",
"assignableClazz",
")",
"{",
"try",
"{",
"if",
"(",
"typeName",
"instanceof",
"ParameterizedTypeName",
")",
"{",
"typeName",
"=",
"(",
"(",
"ParameterizedT... | Checks if is assignable.
@param typeName
the type name
@param assignableClazz
the assignable clazz
@return true, if is assignable | [
"Checks",
"if",
"is",
"assignable",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L744-L757 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.extractPackageName | public static String extractPackageName(TypeElement element) {
String fullName = element.getQualifiedName().toString();
if (fullName.lastIndexOf(".") > 0) {
return fullName.substring(0, fullName.lastIndexOf("."));
}
return "";
} | java | public static String extractPackageName(TypeElement element) {
String fullName = element.getQualifiedName().toString();
if (fullName.lastIndexOf(".") > 0) {
return fullName.substring(0, fullName.lastIndexOf("."));
}
return "";
} | [
"public",
"static",
"String",
"extractPackageName",
"(",
"TypeElement",
"element",
")",
"{",
"String",
"fullName",
"=",
"element",
".",
"getQualifiedName",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"fullName",
".",
"lastIndexOf",
"(",
"\".\"",
")"... | Extract package name.
@param element
the element
@return the string | [
"Extract",
"package",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L767-L774 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.analyzeVariableStatementInternal | protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, final String jql, L listener) {
walker.walk(listener, prepareVariableStatement(jqlContext, jql).value0);
} | java | protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, final String jql, L listener) {
walker.walk(listener, prepareVariableStatement(jqlContext, jql).value0);
} | [
"protected",
"<",
"L",
"extends",
"JqlBaseListener",
">",
"void",
"analyzeVariableStatementInternal",
"(",
"JQLContext",
"jqlContext",
",",
"final",
"String",
"jql",
",",
"L",
"listener",
")",
"{",
"walker",
".",
"walk",
"(",
"listener",
",",
"prepareVariableState... | Analyze variable statement internal.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param listener
the listener | [
"Analyze",
"variable",
"statement",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L131-L133 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.prepareParser | protected Pair<ParserRuleContext, CommonTokenStream> prepareParser(final JQLContext jqlContext, final String jql) {
JqlLexer lexer = new JqlLexer(CharStreams.fromString(jql));
CommonTokenStream tokens = new CommonTokenStream(lexer);
JqlParser parser = new JqlParser(tokens);
parser.removeErrorListeners();
par... | java | protected Pair<ParserRuleContext, CommonTokenStream> prepareParser(final JQLContext jqlContext, final String jql) {
JqlLexer lexer = new JqlLexer(CharStreams.fromString(jql));
CommonTokenStream tokens = new CommonTokenStream(lexer);
JqlParser parser = new JqlParser(tokens);
parser.removeErrorListeners();
par... | [
"protected",
"Pair",
"<",
"ParserRuleContext",
",",
"CommonTokenStream",
">",
"prepareParser",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"final",
"String",
"jql",
")",
"{",
"JqlLexer",
"lexer",
"=",
"new",
"JqlLexer",
"(",
"CharStreams",
".",
"fromString",
... | Prepare parser.
@param jqlContext
the jql context
@param jql
the jql
@return the pair | [
"Prepare",
"parser",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L160-L175 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractColumnsToInsertOrUpdate | public Set<String> extractColumnsToInsertOrUpdate(final JQLContext jqlContext, String jqlValue, final Finder<SQLProperty> entity) {
final Set<String> result = new LinkedHashSet<String>();
final One<Boolean> selectionOn = new One<Boolean>(null);
final One<Boolean> insertOn = new One<Boolean>(null);
// Column_n... | java | public Set<String> extractColumnsToInsertOrUpdate(final JQLContext jqlContext, String jqlValue, final Finder<SQLProperty> entity) {
final Set<String> result = new LinkedHashSet<String>();
final One<Boolean> selectionOn = new One<Boolean>(null);
final One<Boolean> insertOn = new One<Boolean>(null);
// Column_n... | [
"public",
"Set",
"<",
"String",
">",
"extractColumnsToInsertOrUpdate",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jqlValue",
",",
"final",
"Finder",
"<",
"SQLProperty",
">",
"entity",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"result",
"=",
... | Extract columns to insert or update.
@param jqlContext
the jql context
@param jqlValue
the jql value
@param entity
the entity
@return the sets the | [
"Extract",
"columns",
"to",
"insert",
"or",
"update",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L330-L380 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.replaceInternal | private String replaceInternal(final JQLContext jqlContext, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareParser(jqlContext, jql);
walker.walk(rewriterListener, parser.value0);
TokenStreamRewriter rewri... | java | private String replaceInternal(final JQLContext jqlContext, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareParser(jqlContext, jql);
walker.walk(rewriterListener, parser.value0);
TokenStreamRewriter rewri... | [
"private",
"String",
"replaceInternal",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"List",
"<",
"Triple",
"<",
"Token",
",",
"Token",
",",
"String",
">",
">",
"replace",
",",
"JqlBaseListener",
"rewriterListener",
")",
"{",
... | Replace internal.
@param jqlContext
the jql context
@param jql
the jql
@param replace
the replace
@param rewriterListener
the rewriter listener
@return the string | [
"Replace",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L697-L708 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.replaceFromVariableStatementInternal | private String replaceFromVariableStatementInternal(JQLContext context, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareVariableStatement(context, jql);
walker.walk(rewriterListener, parser.value0);
Token... | java | private String replaceFromVariableStatementInternal(JQLContext context, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareVariableStatement(context, jql);
walker.walk(rewriterListener, parser.value0);
Token... | [
"private",
"String",
"replaceFromVariableStatementInternal",
"(",
"JQLContext",
"context",
",",
"String",
"jql",
",",
"final",
"List",
"<",
"Triple",
"<",
"Token",
",",
"Token",
",",
"String",
">",
">",
"replace",
",",
"JqlBaseListener",
"rewriterListener",
")",
... | Replace from variable statement internal.
@param context
the context
@param jql
the jql
@param replace
the replace
@param rewriterListener
the rewriter listener
@return the string | [
"Replace",
"from",
"variable",
"statement",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L723-L734 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractPlaceHolders | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterCon... | java | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterCon... | [
"private",
"<",
"L",
"extends",
"Collection",
"<",
"JQLPlaceHolder",
">",
">",
"L",
"extractPlaceHolders",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"L",
"result",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"valid",
... | Extract place holders.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param result
the result
@return the l | [
"Extract",
"place",
"holders",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L876-L900 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractPlaceHoldersFromVariableStatement | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHoldersFromVariableStatement(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
if (!StringUtils.hasText(jql))
return result;
valid.value0 = false;
analyzeVariableStatementInternal(jqlContext, jql,... | java | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHoldersFromVariableStatement(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
if (!StringUtils.hasText(jql))
return result;
valid.value0 = false;
analyzeVariableStatementInternal(jqlContext, jql,... | [
"private",
"<",
"L",
"extends",
"Collection",
"<",
"JQLPlaceHolder",
">",
">",
"L",
"extractPlaceHoldersFromVariableStatement",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"L",
"result",
")",
"{",
"final",
"One",
"<",
"Boolean",... | Extract place holders from variable statement.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param result
the result
@return the l | [
"Extract",
"place",
"holders",
"from",
"variable",
"statement",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L915-L943 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/ObjectBindTransform.java | ObjectBindTransform.generateSerializeInternal | void generateSerializeInternal(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property, boolean onString) {
TypeName typeName = property.getPropertyType().getTypeName();
String bindName = context.getBindMapperName(context, typeNam... | java | void generateSerializeInternal(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property, boolean onString) {
TypeName typeName = property.getPropertyType().getTypeName();
String bindName = context.getBindMapperName(context, typeNam... | [
"void",
"generateSerializeInternal",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"serializerName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"BindProperty",
"property",
",",
"boolean",
"onSt... | Generate serialize internal.
@param context the context
@param methodBuilder the method builder
@param serializerName the serializer name
@param beanClass the bean class
@param beanName the bean name
@param property the property
@param onString the on string | [
"Generate",
"serialize",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/ObjectBindTransform.java#L104-L136 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoBuilder.java | BindDaoBuilder.daoName | public static String daoName(SQLiteDaoDefinition value) {
String classTableName = value.getName();
classTableName = classTableName + SUFFIX;
return classTableName;
} | java | public static String daoName(SQLiteDaoDefinition value) {
String classTableName = value.getName();
classTableName = classTableName + SUFFIX;
return classTableName;
} | [
"public",
"static",
"String",
"daoName",
"(",
"SQLiteDaoDefinition",
"value",
")",
"{",
"String",
"classTableName",
"=",
"value",
".",
"getName",
"(",
")",
";",
"classTableName",
"=",
"classTableName",
"+",
"SUFFIX",
";",
"return",
"classTableName",
";",
"}"
] | Dao name.
@param value
the value
@return typeName of dao | [
"Dao",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoBuilder.java#L322-L326 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsArrayOfClassName | static List<String> extractAsArrayOfClassName(String value) {
Matcher matcher = classPattern.matcher(value);
List<String> result = new ArrayList<String>();
while (matcher.find()) {
result.add(matcher.group(1));
}
return result;
} | java | static List<String> extractAsArrayOfClassName(String value) {
Matcher matcher = classPattern.matcher(value);
List<String> result = new ArrayList<String>();
while (matcher.find()) {
result.add(matcher.group(1));
}
return result;
} | [
"static",
"List",
"<",
"String",
">",
"extractAsArrayOfClassName",
"(",
"String",
"value",
")",
"{",
"Matcher",
"matcher",
"=",
"classPattern",
".",
"matcher",
"(",
"value",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Str... | Extract as array of class name.
@param value the value
@return the list | [
"Extract",
"as",
"array",
"of",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L64-L74 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsArrayOfString | public static List<String> extractAsArrayOfString(String value) {
Matcher matcher = arrayPattern.matcher(value);
List<String> result = new ArrayList<String>();
// we need to unscape javascript format, otherwise string like " where id like '%' " will become " where id like \'%\' "
while (matcher.find()) {
... | java | public static List<String> extractAsArrayOfString(String value) {
Matcher matcher = arrayPattern.matcher(value);
List<String> result = new ArrayList<String>();
// we need to unscape javascript format, otherwise string like " where id like '%' " will become " where id like \'%\' "
while (matcher.find()) {
... | [
"public",
"static",
"List",
"<",
"String",
">",
"extractAsArrayOfString",
"(",
"String",
"value",
")",
"{",
"Matcher",
"matcher",
"=",
"arrayPattern",
".",
"matcher",
"(",
"value",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<... | Extract as array of string.
@param value the value
@return the list | [
"Extract",
"as",
"array",
"of",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L82-L93 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.forEachAnnotations | public static void forEachAnnotations(Element currentElement, AnnotationFilter filter, AnnotationFoundListener listener) {
final Elements elementUtils=BaseProcessor.elementUtils;
List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(currentElement);
String annotationClassName;
/... | java | public static void forEachAnnotations(Element currentElement, AnnotationFilter filter, AnnotationFoundListener listener) {
final Elements elementUtils=BaseProcessor.elementUtils;
List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(currentElement);
String annotationClassName;
/... | [
"public",
"static",
"void",
"forEachAnnotations",
"(",
"Element",
"currentElement",
",",
"AnnotationFilter",
"filter",
",",
"AnnotationFoundListener",
"listener",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",
"elementUtils",
";",
"List",
"<... | Iterate over annotations of currentElement. Accept only annotation in
accepted set.
@param currentElement the current element
@param filter the filter
@param listener the listener | [
"Iterate",
"over",
"annotations",
"of",
"currentElement",
".",
"Accept",
"only",
"annotation",
"in",
"accepted",
"set",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L145-L173 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractString | static void extractString(Elements elementUtils, Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
extractAttributeValue(elementUtils, item, annotationClass.getCanonicalName(), attribute, listener);
} | java | static void extractString(Elements elementUtils, Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
extractAttributeValue(elementUtils, item, annotationClass.getCanonicalName(), attribute, listener);
} | [
"static",
"void",
"extractString",
"(",
"Elements",
"elementUtils",
",",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attribute",
",",
"OnAttributeFoundListener",
"listener",
")",
"{",
"... | Extract string.
@param elementUtils the element utils
@param item the item
@param annotationClass the annotation class
@param attribute the attribute
@param listener the listener | [
"Extract",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L340-L342 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.buildAnnotationList | public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
final List<ModelAnnotation> annotationList=new ArrayList<>();
forEachAnnotations(element, filter, new AnnotationFoundListener() {
@Override
public void onAcceptAnnotation(Element executableMetho... | java | public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
final List<ModelAnnotation> annotationList=new ArrayList<>();
forEachAnnotations(element, filter, new AnnotationFoundListener() {
@Override
public void onAcceptAnnotation(Element executableMetho... | [
"public",
"static",
"List",
"<",
"ModelAnnotation",
">",
"buildAnnotationList",
"(",
"final",
"Element",
"element",
",",
"final",
"AnnotationFilter",
"filter",
")",
"{",
"final",
"List",
"<",
"ModelAnnotation",
">",
"annotationList",
"=",
"new",
"ArrayList",
"<>",... | Builds the annotation list.
@param element the element
@param filter the filter
@return the list | [
"Builds",
"the",
"annotation",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L422-L436 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsInt | public static int extractAsInt(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Integer> result = new One<Integer>();
result.value0 = 0;
extractString(elementUtils, item, annotationClass, attrib... | java | public static int extractAsInt(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Integer> result = new One<Integer>();
result.value0 = 0;
extractString(elementUtils, item, annotationClass, attrib... | [
"public",
"static",
"int",
"extractAsInt",
"(",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attributeName",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",
"... | Extract as int.
@param item the item
@param annotationClass the annotation class
@param attributeName the attribute name
@return the int | [
"Extract",
"as",
"int",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L532-L546 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsBoolean | public static boolean extractAsBoolean(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractString(elementUtils, item, annotationClass, attribute, new OnA... | java | public static boolean extractAsBoolean(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractString(elementUtils, item, annotationClass, attribute, new OnA... | [
"public",
"static",
"boolean",
"extractAsBoolean",
"(",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attribute",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",... | Extract as boolean.
@param item the item
@param annotationClass the annotation class
@param attribute the attribute
@return true, if successful | [
"Extract",
"as",
"boolean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L556-L569 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsBoolean | public static <E extends ModelEntity<?>> boolean extractAsBoolean(E item, ModelAnnotation annotation, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractAttributeValue(elementUtils, item.getElement(), annotation... | java | public static <E extends ModelEntity<?>> boolean extractAsBoolean(E item, ModelAnnotation annotation, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractAttributeValue(elementUtils, item.getElement(), annotation... | [
"public",
"static",
"<",
"E",
"extends",
"ModelEntity",
"<",
"?",
">",
">",
"boolean",
"extractAsBoolean",
"(",
"E",
"item",
",",
"ModelAnnotation",
"annotation",
",",
"AnnotationAttributeType",
"attribute",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"B... | Estract from an annotation of a method the attribute value specified.
@param <E> the element type
@param item entity to analyze
@param annotation annotation to analyze
@param attribute the attribute
@return true, if successful | [
"Estract",
"from",
"an",
"annotation",
"of",
"a",
"method",
"the",
"attribute",
"value",
"specified",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L580-L593 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.getAnnotationAttributeAsBoolean | public static Boolean getAnnotationAttributeAsBoolean(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, Boolean defaultValue) {
return getAnnotationAttribute(model, annotation, attribute, defaultValue, new OnAnnotationAttributeListener<Boolean>() {
@Override
... | java | public static Boolean getAnnotationAttributeAsBoolean(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, Boolean defaultValue) {
return getAnnotationAttribute(model, annotation, attribute, defaultValue, new OnAnnotationAttributeListener<Boolean>() {
@Override
... | [
"public",
"static",
"Boolean",
"getAnnotationAttributeAsBoolean",
"(",
"ModelWithAnnotation",
"model",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"AnnotationAttributeType",
"attribute",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
... | Gets the annotation attribute as boolean.
@param model the model
@param annotation the annotation
@param attribute the attribute
@param defaultValue the default value
@return the annotation attribute as boolean | [
"Gets",
"the",
"annotation",
"attribute",
"as",
"boolean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L604-L612 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.getAnnotationAttribute | static <T> T getAnnotationAttribute(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, T defaultValue,
OnAnnotationAttributeListener<T> listener) {
String attributeResult;
ModelAnnotation item = model.getAnnotation(annotation);
if (item != null) {
attribut... | java | static <T> T getAnnotationAttribute(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, T defaultValue,
OnAnnotationAttributeListener<T> listener) {
String attributeResult;
ModelAnnotation item = model.getAnnotation(annotation);
if (item != null) {
attribut... | [
"static",
"<",
"T",
">",
"T",
"getAnnotationAttribute",
"(",
"ModelWithAnnotation",
"model",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"AnnotationAttributeType",
"attribute",
",",
"T",
"defaultValue",
",",
"OnAnnotationAttributeListener"... | Gets the annotation attribute.
@param <T> the generic type
@param model the model
@param annotation the annotation
@param attribute the attribute
@param defaultValue the default value
@param listener the listener
@return the annotation attribute | [
"Gets",
"the",
"annotation",
"attribute",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L626-L638 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeContext.java | BindTypeContext.getBindMapperName | public String getBindMapperName(BindTypeContext context, TypeName typeName) {
Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
TypeName bindMapperName=TypeUtility.mergeTypeNameWithSuffix(typeName,BindTypeBuilder.SUFFIX);
String simpleName=format.convert(TypeUtility.si... | java | public String getBindMapperName(BindTypeContext context, TypeName typeName) {
Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
TypeName bindMapperName=TypeUtility.mergeTypeNameWithSuffix(typeName,BindTypeBuilder.SUFFIX);
String simpleName=format.convert(TypeUtility.si... | [
"public",
"String",
"getBindMapperName",
"(",
"BindTypeContext",
"context",
",",
"TypeName",
"typeName",
")",
"{",
"Converter",
"<",
"String",
",",
"String",
">",
"format",
"=",
"CaseFormat",
".",
"UPPER_CAMEL",
".",
"converterTo",
"(",
"CaseFormat",
".",
"LOWER... | Gets the bind mapper name.
@param context the context
@param typeName the type name
@return the bind mapper name | [
"Gets",
"the",
"bind",
"mapper",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeContext.java#L70-L93 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertRawHelper.java | InsertRawHelper.generateJavaDocReturnType | public static void generateJavaDocReturnType(MethodSpec.Builder methodBuilder, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (TypeUtility.isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
methodBuilder.addJavadoc("@return <code>true</code> if r... | java | public static void generateJavaDocReturnType(MethodSpec.Builder methodBuilder, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (TypeUtility.isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
methodBuilder.addJavadoc("@return <code>true</code> if r... | [
"public",
"static",
"void",
"generateJavaDocReturnType",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"returnType",
")",
"{",
"if",
"(",
"returnType",
"==",
"TypeName",
".",
"VOID",
")",
"{",
"}",
"else",
"if",
"(",
"TypeUtility",
".",
... | Generate javadoc about return type of method.
@param methodBuilder the method builder
@param returnType the return type | [
"Generate",
"javadoc",
"about",
"return",
"type",
"of",
"method",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertRawHelper.java#L287-L301 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/PropertyUtility.java | PropertyUtility.modifierIsAcceptable | static boolean modifierIsAcceptable(Element item) {
// kotlin define properties as final
Object[] values = { Modifier.NATIVE, Modifier.STATIC, /* Modifier.FINAL, */ Modifier.ABSTRACT };
for (Object i : values) {
if (item.getModifiers().contains(i))
return false;
}
return true;
} | java | static boolean modifierIsAcceptable(Element item) {
// kotlin define properties as final
Object[] values = { Modifier.NATIVE, Modifier.STATIC, /* Modifier.FINAL, */ Modifier.ABSTRACT };
for (Object i : values) {
if (item.getModifiers().contains(i))
return false;
}
return true;
} | [
"static",
"boolean",
"modifierIsAcceptable",
"(",
"Element",
"item",
")",
"{",
"// kotlin define properties as final",
"Object",
"[",
"]",
"values",
"=",
"{",
"Modifier",
".",
"NATIVE",
",",
"Modifier",
".",
"STATIC",
",",
"/* Modifier.FINAL, */",
"Modifier",
".",
... | Modifier is acceptable.
@param item
the item
@return true, if successful | [
"Modifier",
"is",
"acceptable",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/PropertyUtility.java#L259-L269 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertListBeanHelper.java | InsertListBeanHelper.getConflictAlgorithmType | public static ConflictAlgorithmType getConflictAlgorithmType(SQLiteModelMethod method) {
ModelAnnotation annotation = method.getAnnotation(BindSqlInsert.class);
String value = annotation.getAttribute(AnnotationAttributeType.CONFLICT_ALGORITHM_TYPE);
if (value != null && value.indexOf(".") > -1) {
value = val... | java | public static ConflictAlgorithmType getConflictAlgorithmType(SQLiteModelMethod method) {
ModelAnnotation annotation = method.getAnnotation(BindSqlInsert.class);
String value = annotation.getAttribute(AnnotationAttributeType.CONFLICT_ALGORITHM_TYPE);
if (value != null && value.indexOf(".") > -1) {
value = val... | [
"public",
"static",
"ConflictAlgorithmType",
"getConflictAlgorithmType",
"(",
"SQLiteModelMethod",
"method",
")",
"{",
"ModelAnnotation",
"annotation",
"=",
"method",
".",
"getAnnotation",
"(",
"BindSqlInsert",
".",
"class",
")",
";",
"String",
"value",
"=",
"annotati... | Gets the conflict algorithm type.
@param method
the method
@return the conflict algorithm type | [
"Gets",
"the",
"conflict",
"algorithm",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertListBeanHelper.java#L272-L283 | train |
tzaeschke/zoodb | src/org/zoodb/tools/ZooXmlImport.java | ZooXmlImport.readln1 | private boolean readln1(String strExpected, String strAlternative) {
String sX = scanner.next();
if (sX.equals(strExpected)) {
return true;
}
if (sX.equals(strAlternative)) {
return false;
}
throw new IllegalStateException("Expected: " + strAlternative + " but got: " + sX);
} | java | private boolean readln1(String strExpected, String strAlternative) {
String sX = scanner.next();
if (sX.equals(strExpected)) {
return true;
}
if (sX.equals(strAlternative)) {
return false;
}
throw new IllegalStateException("Expected: " + strAlternative + " but got: " + sX);
} | [
"private",
"boolean",
"readln1",
"(",
"String",
"strExpected",
",",
"String",
"strAlternative",
")",
"{",
"String",
"sX",
"=",
"scanner",
".",
"next",
"(",
")",
";",
"if",
"(",
"sX",
".",
"equals",
"(",
"strExpected",
")",
")",
"{",
"return",
"true",
"... | Reads '1' token.
@param strExpected
@param strAlternative
@return true if 1st string matches, or false if second matches
@throws IllegalStateException if neither String matches | [
"Reads",
"1",
"token",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/tools/ZooXmlImport.java#L349-L358 | train |
tzaeschke/zoodb | src/org/zoodb/internal/server/index/FreeSpaceManager.java | FreeSpaceManager.getNextPage | public int getNextPage(int prevPage) {
reportFreePage(prevPage);
if (iter.hasNextULL()) {
//ArrayList<Long> toDelete = new ArrayList<>();
LongLongIndex.LLEntry e = iter.nextULL();
long pageId = e.getKey();
long value = e.getValue();
// do not return pages that are PID_DO_NOT_USE.
while ((va... | java | public int getNextPage(int prevPage) {
reportFreePage(prevPage);
if (iter.hasNextULL()) {
//ArrayList<Long> toDelete = new ArrayList<>();
LongLongIndex.LLEntry e = iter.nextULL();
long pageId = e.getKey();
long value = e.getValue();
// do not return pages that are PID_DO_NOT_USE.
while ((va... | [
"public",
"int",
"getNextPage",
"(",
"int",
"prevPage",
")",
"{",
"reportFreePage",
"(",
"prevPage",
")",
";",
"if",
"(",
"iter",
".",
"hasNextULL",
"(",
")",
")",
"{",
"//ArrayList<Long> toDelete = new ArrayList<>();",
"LongLongIndex",
".",
"LLEntry",
"e",
"=",... | Get a new free page.
@param prevPage Any previous page that is not required anymore, but
can only be re-used in the following transaction.
@return New free page. | [
"Get",
"a",
"new",
"free",
"page",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/FreeSpaceManager.java#L173-L219 | train |
tzaeschke/zoodb | src/org/zoodb/internal/util/PoolDDS.java | PoolDDS.offer | public final void offer(DataDeSerializer e) {
//discard if pool is full
lock();
try {
if (count < items.length) {
items[count++] = e;
}
} finally {
unlock();
}
} | java | public final void offer(DataDeSerializer e) {
//discard if pool is full
lock();
try {
if (count < items.length) {
items[count++] = e;
}
} finally {
unlock();
}
} | [
"public",
"final",
"void",
"offer",
"(",
"DataDeSerializer",
"e",
")",
"{",
"//discard if pool is full",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"count",
"<",
"items",
".",
"length",
")",
"{",
"items",
"[",
"count",
"++",
"]",
"=",
"e",
";",
"}... | Return an object. The object may be discarded if the pool is full.
@param e object to return | [
"Return",
"an",
"object",
".",
"The",
"object",
"may",
"be",
"discarded",
"if",
"the",
"pool",
"is",
"full",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/PoolDDS.java#L73-L83 | train |
tzaeschke/zoodb | src/org/zoodb/internal/query/QueryOptimizer.java | QueryOptimizer.determineIndexToUse | public List<QueryAdvice> determineIndexToUse(QueryTreeNode queryTree) {
List<QueryAdvice> advices = new LinkedList<QueryAdvice>();
List<ZooFieldDef> availableIndices = new LinkedList<ZooFieldDef>();
for (ZooFieldDef f: clsDef.getAllFields()) {
if (f.isIndexed()) {
availableIndices.add(f);
}
}
// st... | java | public List<QueryAdvice> determineIndexToUse(QueryTreeNode queryTree) {
List<QueryAdvice> advices = new LinkedList<QueryAdvice>();
List<ZooFieldDef> availableIndices = new LinkedList<ZooFieldDef>();
for (ZooFieldDef f: clsDef.getAllFields()) {
if (f.isIndexed()) {
availableIndices.add(f);
}
}
// st... | [
"public",
"List",
"<",
"QueryAdvice",
">",
"determineIndexToUse",
"(",
"QueryTreeNode",
"queryTree",
")",
"{",
"List",
"<",
"QueryAdvice",
">",
"advices",
"=",
"new",
"LinkedList",
"<",
"QueryAdvice",
">",
"(",
")",
";",
"List",
"<",
"ZooFieldDef",
">",
"ava... | Determine index to use.
Policy:
1) Check if index are available. If not, do not perform any further query analysis (for now)
Query rewriting may still be able to optimize really stupid queries.
2) Create sub-queries
3) Analyse sub-queries to determine best index to use. Result may imply that index usage is
pointless (... | [
"Determine",
"index",
"to",
"use",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/query/QueryOptimizer.java#L79-L152 | train |
tzaeschke/zoodb | src/org/zoodb/internal/server/index/AbstractIndexPage.java | AbstractIndexPage.getPagePosition | int getPagePosition(AbstractIndexPage indexPage) {
//We know that the element exists, so we iterate to list.length instead of nEntires
//(which is not available in this context at the moment.
for (int i = 0; i < subPages.length; i++) {
if (subPages[i] == indexPage) {
return i;
}
}
throw DBLogger.ne... | java | int getPagePosition(AbstractIndexPage indexPage) {
//We know that the element exists, so we iterate to list.length instead of nEntires
//(which is not available in this context at the moment.
for (int i = 0; i < subPages.length; i++) {
if (subPages[i] == indexPage) {
return i;
}
}
throw DBLogger.ne... | [
"int",
"getPagePosition",
"(",
"AbstractIndexPage",
"indexPage",
")",
"{",
"//We know that the element exists, so we iterate to list.length instead of nEntires ",
"//(which is not available in this context at the moment.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"subPage... | This method will fail if called on the first page in the tree. However this should not
happen, because when called, we already have a reference to a previous page.
@param oidIndexPage
@return The position of the given page in the subPage-array with 0 <= pos <= nEntries. | [
"This",
"method",
"will",
"fail",
"if",
"called",
"on",
"the",
"first",
"page",
"in",
"the",
"tree",
".",
"However",
"this",
"should",
"not",
"happen",
"because",
"when",
"called",
"we",
"already",
"have",
"a",
"reference",
"to",
"a",
"previous",
"page",
... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/AbstractIndexPage.java#L407-L417 | train |
tzaeschke/zoodb | src/org/zoodb/internal/Session.java | Session.loadAllInstances | private void loadAllInstances(ZooClassProxy def, boolean subClasses,
MergingIterator<ZooPC> iter, boolean loadFromCache) {
for (Node n: nodes) {
iter.add(n.loadAllInstances(def, loadFromCache));
}
if (subClasses) {
for (ZooClassProxy sub: def.getSubProxies()) {
loadAllInstances(sub, true,... | java | private void loadAllInstances(ZooClassProxy def, boolean subClasses,
MergingIterator<ZooPC> iter, boolean loadFromCache) {
for (Node n: nodes) {
iter.add(n.loadAllInstances(def, loadFromCache));
}
if (subClasses) {
for (ZooClassProxy sub: def.getSubProxies()) {
loadAllInstances(sub, true,... | [
"private",
"void",
"loadAllInstances",
"(",
"ZooClassProxy",
"def",
",",
"boolean",
"subClasses",
",",
"MergingIterator",
"<",
"ZooPC",
">",
"iter",
",",
"boolean",
"loadFromCache",
")",
"{",
"for",
"(",
"Node",
"n",
":",
"nodes",
")",
"{",
"iter",
".",
"a... | This method avoids nesting MergingIterators.
@param def
@param subClasses
@param iter | [
"This",
"method",
"avoids",
"nesting",
"MergingIterators",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/Session.java#L473-L484 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.