id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29,200 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/PreCompileMojo.java | PreCompileMojo.setSystemProperties | private void setSystemProperties()
{
if ( systemProperties != null )
{
originalSystemProperties = System.getProperties();
for ( Property systemProperty : systemProperties )
{
String value = systemProperty.getValue();
System.setPrope... | java | private void setSystemProperties()
{
if ( systemProperties != null )
{
originalSystemProperties = System.getProperties();
for ( Property systemProperty : systemProperties )
{
String value = systemProperty.getValue();
System.setPrope... | [
"private",
"void",
"setSystemProperties",
"(",
")",
"{",
"if",
"(",
"systemProperties",
"!=",
"null",
")",
"{",
"originalSystemProperties",
"=",
"System",
".",
"getProperties",
"(",
")",
";",
"for",
"(",
"Property",
"systemProperty",
":",
"systemProperties",
")"... | Pass any given system properties to the java system properties. | [
"Pass",
"any",
"given",
"system",
"properties",
"to",
"the",
"java",
"system",
"properties",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/PreCompileMojo.java#L528-L539 |
29,201 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/PreCompileMojo.java | PreCompileMojo.getExecutablePomArtifact | private Artifact getExecutablePomArtifact( Artifact executableArtifact )
{
return this.artifactFactory.createBuildArtifact( executableArtifact.getGroupId(),
executableArtifact.getArtifactId(),
e... | java | private Artifact getExecutablePomArtifact( Artifact executableArtifact )
{
return this.artifactFactory.createBuildArtifact( executableArtifact.getGroupId(),
executableArtifact.getArtifactId(),
e... | [
"private",
"Artifact",
"getExecutablePomArtifact",
"(",
"Artifact",
"executableArtifact",
")",
"{",
"return",
"this",
".",
"artifactFactory",
".",
"createBuildArtifact",
"(",
"executableArtifact",
".",
"getGroupId",
"(",
")",
",",
"executableArtifact",
".",
"getArtifact... | Get the artifact which refers to the POM of the executable artifact.
@param executableArtifact this artifact refers to the actual assembly.
@return an artifact which refers to the POM of the executable artifact. | [
"Get",
"the",
"artifact",
"which",
"refers",
"to",
"the",
"POM",
"of",
"the",
"executable",
"artifact",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/PreCompileMojo.java#L719-L724 |
29,202 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/PreCompileMojo.java | PreCompileMojo.waitFor | private void waitFor( long millis )
{
Object lock = new Object();
synchronized ( lock )
{
try
{
lock.wait( millis );
}
catch ( InterruptedException e )
{
Thread.currentThread().interrupt(); // good pr... | java | private void waitFor( long millis )
{
Object lock = new Object();
synchronized ( lock )
{
try
{
lock.wait( millis );
}
catch ( InterruptedException e )
{
Thread.currentThread().interrupt(); // good pr... | [
"private",
"void",
"waitFor",
"(",
"long",
"millis",
")",
"{",
"Object",
"lock",
"=",
"new",
"Object",
"(",
")",
";",
"synchronized",
"(",
"lock",
")",
"{",
"try",
"{",
"lock",
".",
"wait",
"(",
"millis",
")",
";",
"}",
"catch",
"(",
"InterruptedExce... | Stop program execution for nn millis.
@param millis the number of millis-seconds to wait for, <code>0</code> stops program forever. | [
"Stop",
"program",
"execution",
"for",
"nn",
"millis",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/PreCompileMojo.java#L806-L821 |
29,203 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.createMessageClass | private static List<Class<?>> createMessageClass(ProtoFile protoFile, boolean multi, boolean debug,
boolean generateSouceOnly, File sourceOutputDir, List<CodeDependent> cds, Set<String> compiledClass,
Set<String> enumNames, Set<String> packages, Map<String, String> mappedUniName, boolean isUniNa... | java | private static List<Class<?>> createMessageClass(ProtoFile protoFile, boolean multi, boolean debug,
boolean generateSouceOnly, File sourceOutputDir, List<CodeDependent> cds, Set<String> compiledClass,
Set<String> enumNames, Set<String> packages, Map<String, String> mappedUniName, boolean isUniNa... | [
"private",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"createMessageClass",
"(",
"ProtoFile",
"protoFile",
",",
"boolean",
"multi",
",",
"boolean",
"debug",
",",
"boolean",
"generateSouceOnly",
",",
"File",
"sourceOutputDir",
",",
"List",
"<",
"CodeDe... | Creates the message class.
@param protoFile the proto file
@param multi the multi
@param debug the debug
@param generateSouceOnly the generate souce only
@param sourceOutputDir the source output dir
@param cds the cds
@param compiledClass the compiled class
@param enumNames the enum names
@param packages the packages
... | [
"Creates",
"the",
"message",
"class",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L886-L955 |
29,204 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.doCreate | private static Map<String, IDLProxyObject> doCreate(ProtoFile protoFile, boolean multi, boolean debug, File path,
boolean generateSouceOnly, File sourceOutputDir, List<CodeDependent> cds, Map<String, String> uniMappedName,
boolean isUniName) throws IOException {
return doCreatePro(Arrays... | java | private static Map<String, IDLProxyObject> doCreate(ProtoFile protoFile, boolean multi, boolean debug, File path,
boolean generateSouceOnly, File sourceOutputDir, List<CodeDependent> cds, Map<String, String> uniMappedName,
boolean isUniName) throws IOException {
return doCreatePro(Arrays... | [
"private",
"static",
"Map",
"<",
"String",
",",
"IDLProxyObject",
">",
"doCreate",
"(",
"ProtoFile",
"protoFile",
",",
"boolean",
"multi",
",",
"boolean",
"debug",
",",
"File",
"path",
",",
"boolean",
"generateSouceOnly",
",",
"File",
"sourceOutputDir",
",",
"... | Do create.
@param protoFile the proto file
@param multi the multi
@param debug the debug
@param path the path
@param generateSouceOnly the generate souce only
@param sourceOutputDir the source output dir
@param cds the cds
@param uniMappedName the uni mapped name
@param isUniName the is uni name
@return the map
@throw... | [
"Do",
"create",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1161-L1166 |
29,205 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.getPackages | private static Set<String> getPackages(List<CodeDependent> cds) {
Set<String> ret = new HashSet<String>();
if (cds == null) {
return ret;
}
for (CodeDependent cd : cds) {
ret.add(cd.pkg);
}
return ret;
} | java | private static Set<String> getPackages(List<CodeDependent> cds) {
Set<String> ret = new HashSet<String>();
if (cds == null) {
return ret;
}
for (CodeDependent cd : cds) {
ret.add(cd.pkg);
}
return ret;
} | [
"private",
"static",
"Set",
"<",
"String",
">",
"getPackages",
"(",
"List",
"<",
"CodeDependent",
">",
"cds",
")",
"{",
"Set",
"<",
"String",
">",
"ret",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"cds",
"==",
"null",
")",... | Gets the packages.
@param cds the cds
@return the packages | [
"Gets",
"the",
"packages",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1470-L1480 |
29,206 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/ClassUtils.java | ClassUtils.newInstance | public static Object newInstance(String name) {
try {
return forName(name).newInstance();
} catch (InstantiationException e) {
throw new IllegalStateException(e.getMessage(), e);
} catch (IllegalAccessException e) {
throw new IllegalStateException(e.getMessage... | java | public static Object newInstance(String name) {
try {
return forName(name).newInstance();
} catch (InstantiationException e) {
throw new IllegalStateException(e.getMessage(), e);
} catch (IllegalAccessException e) {
throw new IllegalStateException(e.getMessage... | [
"public",
"static",
"Object",
"newInstance",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"forName",
"(",
"name",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"InstantiationException",
"e",
")",
"{",
"throw",
"new",
"IllegalStateExc... | To new instance by class name
@param name
class name
@return new create instance | [
"To",
"new",
"instance",
"by",
"class",
"name"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/ClassUtils.java#L56-L64 |
29,207 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/ClassUtils.java | ClassUtils.doFormName | public static Class<?> doFormName(String className) throws ClassNotFoundException {
if ("boolean".equals(className))
return boolean.class;
if ("byte".equals(className))
return byte.class;
if ("char".equals(className))
return char.class;
if ("short".equ... | java | public static Class<?> doFormName(String className) throws ClassNotFoundException {
if ("boolean".equals(className))
return boolean.class;
if ("byte".equals(className))
return byte.class;
if ("char".equals(className))
return char.class;
if ("short".equ... | [
"public",
"static",
"Class",
"<",
"?",
">",
"doFormName",
"(",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"\"boolean\"",
".",
"equals",
"(",
"className",
")",
")",
"return",
"boolean",
".",
"class",
";",
"if",
"(",
"\"b... | Use Class.forname to initialize class.
@param className
class name
@return loaded class
@throws ClassNotFoundException
if class not found | [
"Use",
"Class",
".",
"forname",
"to",
"initialize",
"class",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/ClassUtils.java#L115-L160 |
29,208 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/ClassUtils.java | ClassUtils.getBoxedClass | public static Class<?> getBoxedClass(Class<?> type) {
if (type == boolean.class) {
return Boolean.class;
} else if (type == char.class) {
return Character.class;
} else if (type == byte.class) {
return Byte.class;
} else if (type == short.class) {
... | java | public static Class<?> getBoxedClass(Class<?> type) {
if (type == boolean.class) {
return Boolean.class;
} else if (type == char.class) {
return Character.class;
} else if (type == byte.class) {
return Byte.class;
} else if (type == short.class) {
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getBoxedClass",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"boolean",
".",
"class",
")",
"{",
"return",
"Boolean",
".",
"class",
";",
"}",
"else",
"if",
"(",
"type",
"==",
... | Get boxed class for primitive type
@param type
primitive class type
@return Object class type | [
"Get",
"boxed",
"class",
"for",
"primitive",
"type"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/compiler/ClassUtils.java#L180-L200 |
29,209 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/ClassHelper.java | ClassHelper.hasDefaultConstructor | public static boolean hasDefaultConstructor(Class<?> cls) {
if (cls == null) {
return false;
}
try {
cls.getConstructor(new Class<?>[0]);
} catch (NoSuchMethodException e2) {
return false;
} catch (SecurityException e2) {
throw new ... | java | public static boolean hasDefaultConstructor(Class<?> cls) {
if (cls == null) {
return false;
}
try {
cls.getConstructor(new Class<?>[0]);
} catch (NoSuchMethodException e2) {
return false;
} catch (SecurityException e2) {
throw new ... | [
"public",
"static",
"boolean",
"hasDefaultConstructor",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"cls",
".",
"getConstructor",
"(",
"new",
"Class",
"<",
"?",
">",... | To test class if has default constructor method
@param cls target class
@return true if has default constructor method | [
"To",
"test",
"class",
"if",
"has",
"default",
"constructor",
"method"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ClassHelper.java#L310-L322 |
29,210 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/AbstractCodeGenerator.java | AbstractCodeGenerator.getMismatchTypeErroMessage | private String getMismatchTypeErroMessage(FieldType type, Field field) {
return "Type mismatch. @Protobuf required type '" + type.getJavaType() + "' but field type is '"
+ field.getType().getSimpleName() + "' of field name '" + field.getName() + "' on class "
+ field.getDeclar... | java | private String getMismatchTypeErroMessage(FieldType type, Field field) {
return "Type mismatch. @Protobuf required type '" + type.getJavaType() + "' but field type is '"
+ field.getType().getSimpleName() + "' of field name '" + field.getName() + "' on class "
+ field.getDeclar... | [
"private",
"String",
"getMismatchTypeErroMessage",
"(",
"FieldType",
"type",
",",
"Field",
"field",
")",
"{",
"return",
"\"Type mismatch. @Protobuf required type '\"",
"+",
"type",
".",
"getJavaType",
"(",
")",
"+",
"\"' but field type is '\"",
"+",
"field",
".",
"get... | get error message info by type not matched.
@param type the type
@param field the field
@return error message for mismatch type | [
"get",
"error",
"message",
"info",
"by",
"type",
"not",
"matched",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/AbstractCodeGenerator.java#L177-L181 |
29,211 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java | ProtobufProxyUtils.fetchFieldInfos | public static List<FieldInfo> fetchFieldInfos(Class cls, boolean ignoreNoAnnotation) {
// if set ProtobufClass annotation
Annotation annotation = cls.getAnnotation(ProtobufClass.class);
Annotation zipZap = cls.getAnnotation(EnableZigZap.class);
boolean isZipZap = false;
if... | java | public static List<FieldInfo> fetchFieldInfos(Class cls, boolean ignoreNoAnnotation) {
// if set ProtobufClass annotation
Annotation annotation = cls.getAnnotation(ProtobufClass.class);
Annotation zipZap = cls.getAnnotation(EnableZigZap.class);
boolean isZipZap = false;
if... | [
"public",
"static",
"List",
"<",
"FieldInfo",
">",
"fetchFieldInfos",
"(",
"Class",
"cls",
",",
"boolean",
"ignoreNoAnnotation",
")",
"{",
"// if set ProtobufClass annotation\r",
"Annotation",
"annotation",
"=",
"cls",
".",
"getAnnotation",
"(",
"ProtobufClass",
".",
... | Fetch field infos.
@return the list | [
"Fetch",
"field",
"infos",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java#L90-L116 |
29,212 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java | ProtobufProxyUtils.isObjectType | public static boolean isObjectType(Class<?> cls) {
FieldType fieldType = TYPE_MAPPING.get(cls);
if (fieldType != null) {
return false;
}
return true;
} | java | public static boolean isObjectType(Class<?> cls) {
FieldType fieldType = TYPE_MAPPING.get(cls);
if (fieldType != null) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isObjectType",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"FieldType",
"fieldType",
"=",
"TYPE_MAPPING",
".",
"get",
"(",
"cls",
")",
";",
"if",
"(",
"fieldType",
"!=",
"null",
")",
"{",
"return",
"false",
";",
"}",
... | Checks if is object type.
@param cls the cls
@return true, if is object type | [
"Checks",
"if",
"is",
"object",
"type",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java#L263-L270 |
29,213 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java | ProtobufProxyUtils.processProtobufType | public static String processProtobufType(Class<?> cls) {
FieldType fieldType = TYPE_MAPPING.get(cls);
if (fieldType != null) {
return fieldType.getType();
}
return cls.getSimpleName();
} | java | public static String processProtobufType(Class<?> cls) {
FieldType fieldType = TYPE_MAPPING.get(cls);
if (fieldType != null) {
return fieldType.getType();
}
return cls.getSimpleName();
} | [
"public",
"static",
"String",
"processProtobufType",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"FieldType",
"fieldType",
"=",
"TYPE_MAPPING",
".",
"get",
"(",
"cls",
")",
";",
"if",
"(",
"fieldType",
"!=",
"null",
")",
"{",
"return",
"fieldType",
"."... | Process protobuf type.
@param cls the cls
@return the string | [
"Process",
"protobuf",
"type",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ProtobufProxyUtils.java#L278-L285 |
29,214 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getFiledType | public static String getFiledType(FieldType type, boolean isList) {
if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
return "com.google.protobuf.ByteString";
}
// add null check
String defineType = type.getJavaType();
if (isList)... | java | public static String getFiledType(FieldType type, boolean isList) {
if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
return "com.google.protobuf.ByteString";
}
// add null check
String defineType = type.getJavaType();
if (isList)... | [
"public",
"static",
"String",
"getFiledType",
"(",
"FieldType",
"type",
",",
"boolean",
"isList",
")",
"{",
"if",
"(",
"(",
"type",
"==",
"FieldType",
".",
"STRING",
"||",
"type",
"==",
"FieldType",
".",
"BYTES",
")",
"&&",
"!",
"isList",
")",
"{",
"re... | Gets the filed type.
@param type the type
@param isList the is list
@return the filed type | [
"Gets",
"the",
"filed",
"type",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L179-L192 |
29,215 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getMappedTypeSize | public static String getMappedTypeSize(FieldInfo field, int order, FieldType type, boolean isList, boolean isMap,
boolean debug, File path) {
String fieldName = getFieldName(order);
String spath = "null";
if (path != null) {
spath = "new java.io.File(\"" + path.get... | java | public static String getMappedTypeSize(FieldInfo field, int order, FieldType type, boolean isList, boolean isMap,
boolean debug, File path) {
String fieldName = getFieldName(order);
String spath = "null";
if (path != null) {
spath = "new java.io.File(\"" + path.get... | [
"public",
"static",
"String",
"getMappedTypeSize",
"(",
"FieldInfo",
"field",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"boolean",
"isList",
",",
"boolean",
"isMap",
",",
"boolean",
"debug",
",",
"File",
"path",
")",
"{",
"String",
"fieldName",
"="... | Gets the mapped type size.
@param field field
@param order field order
@param type field type
@param isList is field type is a {@link List}
@param isMap the is map
@param debug debug mode if true enable debug.
@param path the path
@return full java expression | [
"Gets",
"the",
"mapped",
"type",
"size",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L227-L273 |
29,216 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getMapFieldGenericParameterString | public static String getMapFieldGenericParameterString(FieldInfo field) {
FieldType fieldType = ProtobufProxyUtils.TYPE_MAPPING.get(field.getGenericKeyType());
String keyClass;
String defaultKeyValue;
if (fieldType == null) {
// may be object or enum
if (Enu... | java | public static String getMapFieldGenericParameterString(FieldInfo field) {
FieldType fieldType = ProtobufProxyUtils.TYPE_MAPPING.get(field.getGenericKeyType());
String keyClass;
String defaultKeyValue;
if (fieldType == null) {
// may be object or enum
if (Enu... | [
"public",
"static",
"String",
"getMapFieldGenericParameterString",
"(",
"FieldInfo",
"field",
")",
"{",
"FieldType",
"fieldType",
"=",
"ProtobufProxyUtils",
".",
"TYPE_MAPPING",
".",
"get",
"(",
"field",
".",
"getGenericKeyType",
"(",
")",
")",
";",
"String",
"key... | Gets the map field generic parameter string.
@param field the field
@return the map field generic parameter string | [
"Gets",
"the",
"map",
"field",
"generic",
"parameter",
"string",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L281-L345 |
29,217 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.computeMapSize | public static <K, V> int computeMapSize(int order, Map<K, V> map, com.google.protobuf.WireFormat.FieldType keyType,
K defaultKey, com.google.protobuf.WireFormat.FieldType valueType, V defalutValue) {
int size = 0;
for (java.util.Map.Entry<K, V> entry : map.entrySet()) {
com.b... | java | public static <K, V> int computeMapSize(int order, Map<K, V> map, com.google.protobuf.WireFormat.FieldType keyType,
K defaultKey, com.google.protobuf.WireFormat.FieldType valueType, V defalutValue) {
int size = 0;
for (java.util.Map.Entry<K, V> entry : map.entrySet()) {
com.b... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"int",
"computeMapSize",
"(",
"int",
"order",
",",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"com",
".",
"google",
".",
"protobuf",
".",
"WireFormat",
".",
"FieldType",
"keyType",
",",
"K",
"defaultKey",... | Compute map size.
@param <K> the key type
@param <V> the value type
@param order the order
@param map the map
@param keyType the key type
@param defaultKey the default key
@param valueType the value type
@param defalutValue the defalut value
@return the int | [
"Compute",
"map",
"size",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L428-L441 |
29,218 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.putMapValue | public static <K, V> void putMapValue(CodedInputStream input, Map<K, V> map,
com.google.protobuf.WireFormat.FieldType keyType, K defaultKey,
com.google.protobuf.WireFormat.FieldType valueType, V defalutValue) throws IOException {
putMapValue(input, map, keyType, defaultKey, valueType,... | java | public static <K, V> void putMapValue(CodedInputStream input, Map<K, V> map,
com.google.protobuf.WireFormat.FieldType keyType, K defaultKey,
com.google.protobuf.WireFormat.FieldType valueType, V defalutValue) throws IOException {
putMapValue(input, map, keyType, defaultKey, valueType,... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"putMapValue",
"(",
"CodedInputStream",
"input",
",",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"com",
".",
"google",
".",
"protobuf",
".",
"WireFormat",
".",
"FieldType",
"keyType",
",",
"K",
"d... | Put map value.
@param <K> the key type
@param <V> the value type
@param input the input
@param map the map
@param keyType the key type
@param defaultKey the default key
@param valueType the value type
@param defalutValue the defalut value
@throws IOException Signals that an I/O exception has occurred. | [
"Put",
"map",
"value",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L456-L461 |
29,219 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.computeObjectSizeNoTag | public static int computeObjectSizeNoTag(Object o) {
int size = 0;
if (o == null) {
return size;
}
Class cls = o.getClass();
Codec target = ProtobufProxy.create(cls);
try {
size = target.size(o);
size = size + CodedOutputStre... | java | public static int computeObjectSizeNoTag(Object o) {
int size = 0;
if (o == null) {
return size;
}
Class cls = o.getClass();
Codec target = ProtobufProxy.create(cls);
try {
size = target.size(o);
size = size + CodedOutputStre... | [
"public",
"static",
"int",
"computeObjectSizeNoTag",
"(",
"Object",
"o",
")",
"{",
"int",
"size",
"=",
"0",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"size",
";",
"}",
"Class",
"cls",
"=",
"o",
".",
"getClass",
"(",
")",
";",
"Codec",
... | Compute object size no tag.
@param o the o
@return the int | [
"Compute",
"object",
"size",
"no",
"tag",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L530-L545 |
29,220 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.writeToList | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
writeToList(out, order, type, list, false);
} | java | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
writeToList(out, order, type, list, false);
} | [
"public",
"static",
"void",
"writeToList",
"(",
"CodedOutputStream",
"out",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"List",
"list",
")",
"throws",
"IOException",
"{",
"writeToList",
"(",
"out",
",",
"order",
",",
"type",
",",
"list",
",",
"fals... | Write to list.
@param out the out
@param order the order
@param type the type
@param list the list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"to",
"list",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L686-L688 |
29,221 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.writeObject | public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list)
throws IOException {
writeObject(out, order, type, o, list, true);
} | java | public static void writeObject(CodedOutputStream out, int order, FieldType type, Object o, boolean list)
throws IOException {
writeObject(out, order, type, o, list, true);
} | [
"public",
"static",
"void",
"writeObject",
"(",
"CodedOutputStream",
"out",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"Object",
"o",
",",
"boolean",
"list",
")",
"throws",
"IOException",
"{",
"writeObject",
"(",
"out",
",",
"order",
",",
"type",
... | Write object.
@param out the out
@param order the order
@param type the type
@param o the o
@param list the list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"object",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L731-L734 |
29,222 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getEnumValue | public static int getEnumValue(Enum en) {
if (en != null) {
int toCompareValue;
if (en instanceof EnumReadable) {
toCompareValue = ((EnumReadable) en).value();
} else {
toCompareValue = en.ordinal();
}
return toC... | java | public static int getEnumValue(Enum en) {
if (en != null) {
int toCompareValue;
if (en instanceof EnumReadable) {
toCompareValue = ((EnumReadable) en).value();
} else {
toCompareValue = en.ordinal();
}
return toC... | [
"public",
"static",
"int",
"getEnumValue",
"(",
"Enum",
"en",
")",
"{",
"if",
"(",
"en",
"!=",
"null",
")",
"{",
"int",
"toCompareValue",
";",
"if",
"(",
"en",
"instanceof",
"EnumReadable",
")",
"{",
"toCompareValue",
"=",
"(",
"(",
"EnumReadable",
")",
... | Gets the enum value.
@param en the en
@return the enum value | [
"Gets",
"the",
"enum",
"value",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1057-L1069 |
29,223 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.readPrimitiveField | public static Object readPrimitiveField(CodedInputStream input, final WireFormat.FieldType type, boolean checkUtf8)
throws IOException {
switch (type) {
case DOUBLE:
return input.readDouble();
case FLOAT:
return input.readFloat();
... | java | public static Object readPrimitiveField(CodedInputStream input, final WireFormat.FieldType type, boolean checkUtf8)
throws IOException {
switch (type) {
case DOUBLE:
return input.readDouble();
case FLOAT:
return input.readFloat();
... | [
"public",
"static",
"Object",
"readPrimitiveField",
"(",
"CodedInputStream",
"input",
",",
"final",
"WireFormat",
".",
"FieldType",
"type",
",",
"boolean",
"checkUtf8",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"DOUBLE",
":",
... | Read a field of any primitive type for immutable messages from a CodedInputStream. Enums, groups, and embedded
messages are not handled by this method.
@param input The stream from which to read.
@param type Declared type of the field.
@param checkUtf8 When true, check that the input is valid utf8.
@return An object r... | [
"Read",
"a",
"field",
"of",
"any",
"primitive",
"type",
"for",
"immutable",
"messages",
"from",
"a",
"CodedInputStream",
".",
"Enums",
"groups",
"and",
"embedded",
"messages",
"are",
"not",
"handled",
"by",
"this",
"method",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1104-L1153 |
29,224 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.writeElement | public static void writeElement(final CodedOutputStream output, final WireFormat.FieldType type, final int number,
final Object value) throws IOException {
// Special case for groups, which need a start and end tag; other fields
// can just use writeTag() and writeFieldNoTag().
i... | java | public static void writeElement(final CodedOutputStream output, final WireFormat.FieldType type, final int number,
final Object value) throws IOException {
// Special case for groups, which need a start and end tag; other fields
// can just use writeTag() and writeFieldNoTag().
i... | [
"public",
"static",
"void",
"writeElement",
"(",
"final",
"CodedOutputStream",
"output",
",",
"final",
"WireFormat",
".",
"FieldType",
"type",
",",
"final",
"int",
"number",
",",
"final",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"// Special case for g... | Write a single tag-value pair to the stream.
@param output The output stream.
@param type The field's type.
@param number The field's number.
@param value Object representing the field's value. Must be of the exact type which would be returned by
{@link Message#getField(Descriptors.FieldDescriptor)} for this field.
@t... | [
"Write",
"a",
"single",
"tag",
"-",
"value",
"pair",
"to",
"the",
"stream",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1165-L1175 |
29,225 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getWireFormatForFieldType | static int getWireFormatForFieldType(final WireFormat.FieldType type, boolean isPacked) {
if (isPacked) {
return WireFormat.WIRETYPE_LENGTH_DELIMITED;
} else {
return type.getWireType();
}
} | java | static int getWireFormatForFieldType(final WireFormat.FieldType type, boolean isPacked) {
if (isPacked) {
return WireFormat.WIRETYPE_LENGTH_DELIMITED;
} else {
return type.getWireType();
}
} | [
"static",
"int",
"getWireFormatForFieldType",
"(",
"final",
"WireFormat",
".",
"FieldType",
"type",
",",
"boolean",
"isPacked",
")",
"{",
"if",
"(",
"isPacked",
")",
"{",
"return",
"WireFormat",
".",
"WIRETYPE_LENGTH_DELIMITED",
";",
"}",
"else",
"{",
"return",
... | Given a field type, return the wire type.
@param type the type
@param isPacked the is packed
@return the wire format for field type
@returns One of the {@code WIRETYPE_} constants defined in {@link WireFormat}. | [
"Given",
"a",
"field",
"type",
"return",
"the",
"wire",
"type",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1185-L1191 |
29,226 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.computeElementSizeNoTag | public static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) {
switch (type) {
// Note: Minor violation of 80-char limit rule here because this would
// actually be harder to read if we wrapped the lines.
case DOUBLE:
ret... | java | public static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) {
switch (type) {
// Note: Minor violation of 80-char limit rule here because this would
// actually be harder to read if we wrapped the lines.
case DOUBLE:
ret... | [
"public",
"static",
"int",
"computeElementSizeNoTag",
"(",
"final",
"WireFormat",
".",
"FieldType",
"type",
",",
"final",
"Object",
"value",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"// Note: Minor violation of 80-char limit rule here because this would\r",
"// actually... | Compute the number of bytes that would be needed to encode a particular value of arbitrary type, excluding tag.
@param type The field's type.
@param value Object representing the field's value. Must be of the exact type which would be returned by
{@link Message#getField(Descriptors.FieldDescriptor)} for this field.
@r... | [
"Compute",
"the",
"number",
"of",
"bytes",
"that",
"would",
"be",
"needed",
"to",
"encode",
"a",
"particular",
"value",
"of",
"arbitrary",
"type",
"excluding",
"tag",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1296-L1359 |
29,227 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getMapKVMessageElements | private static MessageElement getMapKVMessageElements(String name, MapType mapType) {
MessageElement.Builder ret = MessageElement.builder();
ret.name(name);
DataType keyType = mapType.keyType();
Builder fieldBuilder = FieldElement.builder().name("key").tag(1);
fieldBuilder... | java | private static MessageElement getMapKVMessageElements(String name, MapType mapType) {
MessageElement.Builder ret = MessageElement.builder();
ret.name(name);
DataType keyType = mapType.keyType();
Builder fieldBuilder = FieldElement.builder().name("key").tag(1);
fieldBuilder... | [
"private",
"static",
"MessageElement",
"getMapKVMessageElements",
"(",
"String",
"name",
",",
"MapType",
"mapType",
")",
"{",
"MessageElement",
".",
"Builder",
"ret",
"=",
"MessageElement",
".",
"builder",
"(",
")",
";",
"ret",
".",
"name",
"(",
"name",
")",
... | Gets the map kv message elements.
@param name the name
@param mapType the map type
@return the map kv message elements | [
"Gets",
"the",
"map",
"kv",
"message",
"elements",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L1567-L1582 |
29,228 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/IDLProxyObject.java | IDLProxyObject.doGetFieldValue | private Object doGetFieldValue(String fullField, String field, Object object, boolean useCache,
Map<String, ReflectInfo> cachedFields) {
// check cache
Field f;
if (useCache) {
ReflectInfo info = cachedFields.get(fullField);
if (info != null) {
... | java | private Object doGetFieldValue(String fullField, String field, Object object, boolean useCache,
Map<String, ReflectInfo> cachedFields) {
// check cache
Field f;
if (useCache) {
ReflectInfo info = cachedFields.get(fullField);
if (info != null) {
... | [
"private",
"Object",
"doGetFieldValue",
"(",
"String",
"fullField",
",",
"String",
"field",
",",
"Object",
"object",
",",
"boolean",
"useCache",
",",
"Map",
"<",
"String",
",",
"ReflectInfo",
">",
"cachedFields",
")",
"{",
"// check cache",
"Field",
"f",
";",
... | Do get field value.
@param fullField the full field
@param field the field
@param object the object
@param useCache the use cache
@param cachedFields the cached fields
@return the object | [
"Do",
"get",
"field",
"value",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/IDLProxyObject.java#L249-L290 |
29,229 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java | ProtobufProxy.isDebugEnabled | public static boolean isDebugEnabled() {
String debugEnv = System.getenv(DEBUG_CONTROL);
if (debugEnv != null && Boolean.parseBoolean(debugEnv)) {
return true;
}
Boolean debug = DEBUG_CONTROLLER.get();
if (debug == null) {
debug = false; // set de... | java | public static boolean isDebugEnabled() {
String debugEnv = System.getenv(DEBUG_CONTROL);
if (debugEnv != null && Boolean.parseBoolean(debugEnv)) {
return true;
}
Boolean debug = DEBUG_CONTROLLER.get();
if (debug == null) {
debug = false; // set de... | [
"public",
"static",
"boolean",
"isDebugEnabled",
"(",
")",
"{",
"String",
"debugEnv",
"=",
"System",
".",
"getenv",
"(",
"DEBUG_CONTROL",
")",
";",
"if",
"(",
"debugEnv",
"!=",
"null",
"&&",
"Boolean",
".",
"parseBoolean",
"(",
"debugEnv",
")",
")",
"{",
... | Checks if is debug enabled.
@return true, if is debug enabled | [
"Checks",
"if",
"is",
"debug",
"enabled",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java#L109-L121 |
29,230 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java | ProtobufProxy.getCodeGenerator | private static ICodeGenerator getCodeGenerator(Class cls) {
// check if has default constructor
if (!cls.isMemberClass()) {
try {
cls.getConstructor(new Class<?>[0]);
} catch (NoSuchMethodException e2) {
throw new IllegalArgumentException(
... | java | private static ICodeGenerator getCodeGenerator(Class cls) {
// check if has default constructor
if (!cls.isMemberClass()) {
try {
cls.getConstructor(new Class<?>[0]);
} catch (NoSuchMethodException e2) {
throw new IllegalArgumentException(
... | [
"private",
"static",
"ICodeGenerator",
"getCodeGenerator",
"(",
"Class",
"cls",
")",
"{",
"// check if has default constructor",
"if",
"(",
"!",
"cls",
".",
"isMemberClass",
"(",
")",
")",
"{",
"try",
"{",
"cls",
".",
"getConstructor",
"(",
"new",
"Class",
"<"... | Gets the code generator.
@param cls the cls
@return the code generator | [
"Gets",
"the",
"code",
"generator",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java#L166-L183 |
29,231 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ClassHelper.java | ClassHelper.getClassLoader | public static ClassLoader getClassLoader(Class<?> cls) {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back to system
// class loader...
... | java | public static ClassLoader getClassLoader(Class<?> cls) {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back to system
// class loader...
... | [
"public",
"static",
"ClassLoader",
"getClassLoader",
"(",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"ClassLoader",
"cl",
"=",
"null",
";",
"try",
"{",
"cl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"}",
... | get class loader
@param cls target class to get ownered class loader
@return class loader | [
"get",
"class",
"loader"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/ClassHelper.java#L118-L131 |
29,232 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntry.java | MapEntry.newDefaultInstance | public static <K, V> MapEntry<K, V> newDefaultInstance(Descriptor descriptor, WireFormat.FieldType keyType,
K defaultKey, WireFormat.FieldType valueType, V defaultValue) {
return new MapEntry<K, V>(descriptor, keyType, defaultKey, valueType, defaultValue);
} | java | public static <K, V> MapEntry<K, V> newDefaultInstance(Descriptor descriptor, WireFormat.FieldType keyType,
K defaultKey, WireFormat.FieldType valueType, V defaultValue) {
return new MapEntry<K, V>(descriptor, keyType, defaultKey, valueType, defaultValue);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"MapEntry",
"<",
"K",
",",
"V",
">",
"newDefaultInstance",
"(",
"Descriptor",
"descriptor",
",",
"WireFormat",
".",
"FieldType",
"keyType",
",",
"K",
"defaultKey",
",",
"WireFormat",
".",
"FieldType",
"valueType",... | Create a default MapEntry instance. A default MapEntry instance should be created only once for each map entry
message type. Generated code should store the created default instance and use it later to create new MapEntry
messages of the same type.
@param <K> the key type
@param <V> the value type
@param descriptor th... | [
"Create",
"a",
"default",
"MapEntry",
"instance",
".",
"A",
"default",
"MapEntry",
"instance",
"should",
"be",
"created",
"only",
"once",
"for",
"each",
"map",
"entry",
"message",
"type",
".",
"Generated",
"code",
"should",
"store",
"the",
"created",
"default"... | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntry.java#L161-L164 |
29,233 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntry.java | MapEntry.checkFieldDescriptor | private void checkFieldDescriptor(FieldDescriptor field) {
if (field.getContainingType() != metadata.descriptor) {
throw new RuntimeException("Wrong FieldDescriptor \"" + field.getFullName() + "\" used in message \""
+ metadata.descriptor.getFullName());
}
} | java | private void checkFieldDescriptor(FieldDescriptor field) {
if (field.getContainingType() != metadata.descriptor) {
throw new RuntimeException("Wrong FieldDescriptor \"" + field.getFullName() + "\" used in message \""
+ metadata.descriptor.getFullName());
}
} | [
"private",
"void",
"checkFieldDescriptor",
"(",
"FieldDescriptor",
"field",
")",
"{",
"if",
"(",
"field",
".",
"getContainingType",
"(",
")",
"!=",
"metadata",
".",
"descriptor",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Wrong FieldDescriptor \\\"\"",
... | Check field descriptor.
@param field the field | [
"Check",
"field",
"descriptor",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntry.java#L276-L281 |
29,234 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.emptyMapField | public static <K, V> MapField<K, V> emptyMapField(MapEntry<K, V> defaultEntry) {
return new MapField<K, V>(defaultEntry, StorageMode.MAP, Collections.<K, V> emptyMap(), null);
} | java | public static <K, V> MapField<K, V> emptyMapField(MapEntry<K, V> defaultEntry) {
return new MapField<K, V>(defaultEntry, StorageMode.MAP, Collections.<K, V> emptyMap(), null);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"MapField",
"<",
"K",
",",
"V",
">",
"emptyMapField",
"(",
"MapEntry",
"<",
"K",
",",
"V",
">",
"defaultEntry",
")",
"{",
"return",
"new",
"MapField",
"<",
"K",
",",
"V",
">",
"(",
"defaultEntry",
",",
... | Returns an immutable empty MapField. | [
"Returns",
"an",
"immutable",
"empty",
"MapField",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L118-L120 |
29,235 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.newMapField | public static <K, V> MapField<K, V> newMapField(MapEntry<K, V> defaultEntry) {
return new MapField<K, V>(defaultEntry, StorageMode.MAP, new HashMap<K, V>(), null);
} | java | public static <K, V> MapField<K, V> newMapField(MapEntry<K, V> defaultEntry) {
return new MapField<K, V>(defaultEntry, StorageMode.MAP, new HashMap<K, V>(), null);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"MapField",
"<",
"K",
",",
"V",
">",
"newMapField",
"(",
"MapEntry",
"<",
"K",
",",
"V",
">",
"defaultEntry",
")",
"{",
"return",
"new",
"MapField",
"<",
"K",
",",
"V",
">",
"(",
"defaultEntry",
",",
"... | Creates a new mutable empty MapField. | [
"Creates",
"a",
"new",
"mutable",
"empty",
"MapField",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L123-L125 |
29,236 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.getMap | public Map<K, V> getMap() {
if (mode == StorageMode.LIST) {
synchronized (this) {
if (mode == StorageMode.LIST) {
mapData = convertListToMap(listData);
mode = StorageMode.BOTH;
}
}
}
return Collection... | java | public Map<K, V> getMap() {
if (mode == StorageMode.LIST) {
synchronized (this) {
if (mode == StorageMode.LIST) {
mapData = convertListToMap(listData);
mode = StorageMode.BOTH;
}
}
}
return Collection... | [
"public",
"Map",
"<",
"K",
",",
"V",
">",
"getMap",
"(",
")",
"{",
"if",
"(",
"mode",
"==",
"StorageMode",
".",
"LIST",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"mode",
"==",
"StorageMode",
".",
"LIST",
")",
"{",
"mapData",
"="... | Returns the content of this MapField as a read-only Map. | [
"Returns",
"the",
"content",
"of",
"this",
"MapField",
"as",
"a",
"read",
"-",
"only",
"Map",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L153-L163 |
29,237 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.getMutableMap | public Map<K, V> getMutableMap() {
if (mode != StorageMode.MAP) {
if (mode == StorageMode.LIST) {
mapData = convertListToMap(listData);
}
listData = null;
mode = StorageMode.MAP;
}
return mapData;
} | java | public Map<K, V> getMutableMap() {
if (mode != StorageMode.MAP) {
if (mode == StorageMode.LIST) {
mapData = convertListToMap(listData);
}
listData = null;
mode = StorageMode.MAP;
}
return mapData;
} | [
"public",
"Map",
"<",
"K",
",",
"V",
">",
"getMutableMap",
"(",
")",
"{",
"if",
"(",
"mode",
"!=",
"StorageMode",
".",
"MAP",
")",
"{",
"if",
"(",
"mode",
"==",
"StorageMode",
".",
"LIST",
")",
"{",
"mapData",
"=",
"convertListToMap",
"(",
"listData"... | Gets a mutable Map view of this MapField. | [
"Gets",
"a",
"mutable",
"Map",
"view",
"of",
"this",
"MapField",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L166-L175 |
29,238 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.copy | public MapField<K, V> copy() {
return new MapField<K, V>(converter, StorageMode.MAP, MapFieldLite.copy(getMap()), null);
} | java | public MapField<K, V> copy() {
return new MapField<K, V>(converter, StorageMode.MAP, MapFieldLite.copy(getMap()), null);
} | [
"public",
"MapField",
"<",
"K",
",",
"V",
">",
"copy",
"(",
")",
"{",
"return",
"new",
"MapField",
"<",
"K",
",",
"V",
">",
"(",
"converter",
",",
"StorageMode",
".",
"MAP",
",",
"MapFieldLite",
".",
"copy",
"(",
"getMap",
"(",
")",
")",
",",
"nu... | Returns a deep copy of this MapField. | [
"Returns",
"a",
"deep",
"copy",
"of",
"this",
"MapField",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L202-L204 |
29,239 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.getList | List<Message> getList() {
if (mode == StorageMode.MAP) {
synchronized (this) {
if (mode == StorageMode.MAP) {
listData = convertMapToList(mapData);
mode = StorageMode.BOTH;
}
}
}
return Collections.un... | java | List<Message> getList() {
if (mode == StorageMode.MAP) {
synchronized (this) {
if (mode == StorageMode.MAP) {
listData = convertMapToList(mapData);
mode = StorageMode.BOTH;
}
}
}
return Collections.un... | [
"List",
"<",
"Message",
">",
"getList",
"(",
")",
"{",
"if",
"(",
"mode",
"==",
"StorageMode",
".",
"MAP",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"mode",
"==",
"StorageMode",
".",
"MAP",
")",
"{",
"listData",
"=",
"convertMapToLi... | Gets the content of this MapField as a read-only List. | [
"Gets",
"the",
"content",
"of",
"this",
"MapField",
"as",
"a",
"read",
"-",
"only",
"List",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L207-L217 |
29,240 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java | MapField.getMutableList | List<Message> getMutableList() {
if (mode != StorageMode.LIST) {
if (mode == StorageMode.MAP) {
listData = convertMapToList(mapData);
}
mapData = null;
mode = StorageMode.LIST;
}
return listData;
} | java | List<Message> getMutableList() {
if (mode != StorageMode.LIST) {
if (mode == StorageMode.MAP) {
listData = convertMapToList(mapData);
}
mapData = null;
mode = StorageMode.LIST;
}
return listData;
} | [
"List",
"<",
"Message",
">",
"getMutableList",
"(",
")",
"{",
"if",
"(",
"mode",
"!=",
"StorageMode",
".",
"LIST",
")",
"{",
"if",
"(",
"mode",
"==",
"StorageMode",
".",
"MAP",
")",
"{",
"listData",
"=",
"convertMapToList",
"(",
"mapData",
")",
";",
... | Gets a mutable List view of this MapField. | [
"Gets",
"a",
"mutable",
"List",
"view",
"of",
"this",
"MapField",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapField.java#L220-L229 |
29,241 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.genImportCode | private void genImportCode(StringBuilder code) {
code.append("import com.google.protobuf.*").append(JAVA_LINE_BREAK);
code.append("import java.io.IOException").append(JAVA_LINE_BREAK);
code.append("import com.baidu.bjf.remoting.protobuf.utils.*").append(JAVA_LINE_BREAK);
code.append(... | java | private void genImportCode(StringBuilder code) {
code.append("import com.google.protobuf.*").append(JAVA_LINE_BREAK);
code.append("import java.io.IOException").append(JAVA_LINE_BREAK);
code.append("import com.baidu.bjf.remoting.protobuf.utils.*").append(JAVA_LINE_BREAK);
code.append(... | [
"private",
"void",
"genImportCode",
"(",
"StringBuilder",
"code",
")",
"{",
"code",
".",
"append",
"(",
"\"import com.google.protobuf.*\"",
")",
".",
"append",
"(",
"JAVA_LINE_BREAK",
")",
";",
"code",
".",
"append",
"(",
"\"import java.io.IOException\"",
")",
"."... | generate import code
@param code | [
"generate",
"import",
"code"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L260-L272 |
29,242 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeTemplate.java | CodeTemplate.descriptorMethodSource | public static String descriptorMethodSource(Class cls) {
String descriptorClsName = ClassHelper.getInternalName(Descriptor.class.getCanonicalName());
String code = "if (this.descriptor != null) {" + ClassCode.LINE_BREAK +
"return this.descriptor;" + ClassCode.LI... | java | public static String descriptorMethodSource(Class cls) {
String descriptorClsName = ClassHelper.getInternalName(Descriptor.class.getCanonicalName());
String code = "if (this.descriptor != null) {" + ClassCode.LINE_BREAK +
"return this.descriptor;" + ClassCode.LI... | [
"public",
"static",
"String",
"descriptorMethodSource",
"(",
"Class",
"cls",
")",
"{",
"String",
"descriptorClsName",
"=",
"ClassHelper",
".",
"getInternalName",
"(",
"Descriptor",
".",
"class",
".",
"getCanonicalName",
"(",
")",
")",
";",
"String",
"code",
"=",... | Get getDescriptor method source by template.
@param cls the cls
@return the source code for getDescriptor method | [
"Get",
"getDescriptor",
"method",
"source",
"by",
"template",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeTemplate.java#L36-L48 |
29,243 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.createEnumClasses | private static List<Class<?>> createEnumClasses(Map<String, EnumElement> enumTypes,
Map<String, String> packageMapping, boolean generateSouceOnly, File sourceOutputDir,
Set<String> compiledClass, Map<String, String> mappedUniName, boolean isUniName) {
List<Class<?>> ret = new ArrayL... | java | private static List<Class<?>> createEnumClasses(Map<String, EnumElement> enumTypes,
Map<String, String> packageMapping, boolean generateSouceOnly, File sourceOutputDir,
Set<String> compiledClass, Map<String, String> mappedUniName, boolean isUniName) {
List<Class<?>> ret = new ArrayL... | [
"private",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"createEnumClasses",
"(",
"Map",
"<",
"String",
",",
"EnumElement",
">",
"enumTypes",
",",
"Map",
"<",
"String",
",",
"String",
">",
"packageMapping",
",",
"boolean",
"generateSouceOnly",
",",
... | Creates the enum classes.
@param enumTypes the enum types
@param packageMapping the package mapping
@param generateSouceOnly the generate souce only
@param sourceOutputDir the source output dir
@param compiledClass the compiled class
@param mappedUniName the mapped uni name
@param isUniName the is uni name
@return the... | [
"Creates",
"the",
"enum",
"classes",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L848-L881 |
29,244 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.getTypeName | private static String getTypeName(FieldElement field) {
DataType type = field.type();
return type.toString();
} | java | private static String getTypeName(FieldElement field) {
DataType type = field.type();
return type.toString();
} | [
"private",
"static",
"String",
"getTypeName",
"(",
"FieldElement",
"field",
")",
"{",
"DataType",
"type",
"=",
"field",
".",
"type",
"(",
")",
";",
"return",
"type",
".",
"toString",
"(",
")",
";",
"}"
] | Gets the type name.
@param field the field
@return the type name | [
"Gets",
"the",
"type",
"name",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1581-L1584 |
29,245 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapFieldLite.java | MapFieldLite.emptyMapField | @SuppressWarnings({ "unchecked", "cast" })
public static <K, V> MapFieldLite<K, V> emptyMapField() {
return (MapFieldLite<K, V>) EMPTY_MAP_FIELD;
} | java | @SuppressWarnings({ "unchecked", "cast" })
public static <K, V> MapFieldLite<K, V> emptyMapField() {
return (MapFieldLite<K, V>) EMPTY_MAP_FIELD;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"cast\"",
"}",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"MapFieldLite",
"<",
"K",
",",
"V",
">",
"emptyMapField",
"(",
")",
"{",
"return",
"(",
"MapFieldLite",
"<",
"K",
",",
"V",
">... | Returns an singleton immutable empty MapFieldLite instance.
@param <K> the key type
@param <V> the value type
@return the map field lite | [
"Returns",
"an",
"singleton",
"immutable",
"empty",
"MapFieldLite",
"instance",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapFieldLite.java#L72-L75 |
29,246 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapFieldLite.java | MapFieldLite.mergeFrom | public void mergeFrom(MapFieldLite<K, V> other) {
ensureMutable();
if (!other.isEmpty()) {
putAll(other);
}
} | java | public void mergeFrom(MapFieldLite<K, V> other) {
ensureMutable();
if (!other.isEmpty()) {
putAll(other);
}
} | [
"public",
"void",
"mergeFrom",
"(",
"MapFieldLite",
"<",
"K",
",",
"V",
">",
"other",
")",
"{",
"ensureMutable",
"(",
")",
";",
"if",
"(",
"!",
"other",
".",
"isEmpty",
"(",
")",
")",
"{",
"putAll",
"(",
"other",
")",
";",
"}",
"}"
] | Merge from.
@param other the other | [
"Merge",
"from",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapFieldLite.java#L82-L87 |
29,247 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.genImportCode | private void genImportCode(ClassCode code) {
code.importClass("java.util.*");
code.importClass("java.io.IOException");
code.importClass("java.lang.reflect.*");
code.importClass("com.baidu.bjf.remoting.protobuf.code.*");
code.importClass("com.baidu.bjf.remoting.protobuf.utils.*");... | java | private void genImportCode(ClassCode code) {
code.importClass("java.util.*");
code.importClass("java.io.IOException");
code.importClass("java.lang.reflect.*");
code.importClass("com.baidu.bjf.remoting.protobuf.code.*");
code.importClass("com.baidu.bjf.remoting.protobuf.utils.*");... | [
"private",
"void",
"genImportCode",
"(",
"ClassCode",
"code",
")",
"{",
"code",
".",
"importClass",
"(",
"\"java.util.*\"",
")",
";",
"code",
".",
"importClass",
"(",
"\"java.io.IOException\"",
")",
";",
"code",
".",
"importClass",
"(",
"\"java.lang.reflect.*\"",
... | generate import code.
@param code the code | [
"generate",
"import",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L169-L181 |
29,248 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.getDecodeMethodCode | private MethodCode getDecodeMethodCode() {
MethodCode mc = new MethodCode();
mc.setName("decode");
mc.setScope(ClassCode.SCOPE_PUBLIC);
mc.setReturnType(ClassHelper.getInternalName(cls.getCanonicalName()));
mc.addParameter("byte[]", "bb");
mc.addException("IOException");
... | java | private MethodCode getDecodeMethodCode() {
MethodCode mc = new MethodCode();
mc.setName("decode");
mc.setScope(ClassCode.SCOPE_PUBLIC);
mc.setReturnType(ClassHelper.getInternalName(cls.getCanonicalName()));
mc.addParameter("byte[]", "bb");
mc.addException("IOException");
... | [
"private",
"MethodCode",
"getDecodeMethodCode",
"(",
")",
"{",
"MethodCode",
"mc",
"=",
"new",
"MethodCode",
"(",
")",
";",
"mc",
".",
"setName",
"(",
"\"decode\"",
")",
";",
"mc",
".",
"setScope",
"(",
"ClassCode",
".",
"SCOPE_PUBLIC",
")",
";",
"mc",
"... | Gets the decode method code.
@return the decode method code | [
"Gets",
"the",
"decode",
"method",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L355-L369 |
29,249 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.getGetDescriptorMethodCode | private MethodCode getGetDescriptorMethodCode() {
String descriptorClsName = ClassHelper.getInternalName(Descriptor.class.getCanonicalName());
MethodCode mc = new MethodCode();
mc.setName("getDescriptor");
mc.setReturnType(descriptorClsName);
mc.setScope(ClassCode.SCOPE_PUBLIC);... | java | private MethodCode getGetDescriptorMethodCode() {
String descriptorClsName = ClassHelper.getInternalName(Descriptor.class.getCanonicalName());
MethodCode mc = new MethodCode();
mc.setName("getDescriptor");
mc.setReturnType(descriptorClsName);
mc.setScope(ClassCode.SCOPE_PUBLIC);... | [
"private",
"MethodCode",
"getGetDescriptorMethodCode",
"(",
")",
"{",
"String",
"descriptorClsName",
"=",
"ClassHelper",
".",
"getInternalName",
"(",
"Descriptor",
".",
"class",
".",
"getCanonicalName",
"(",
")",
")",
";",
"MethodCode",
"mc",
"=",
"new",
"MethodCo... | Gets the gets the descriptor method code.
@return the gets the descriptor method code | [
"Gets",
"the",
"gets",
"the",
"descriptor",
"method",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L376-L389 |
29,250 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.getWriteToMethodCode | private MethodCode getWriteToMethodCode() {
MethodCode mc = new MethodCode();
mc.setName("writeTo");
mc.setReturnType("void");
mc.setScope(ClassCode.SCOPE_PUBLIC);
mc.addParameter(ClassHelper.getInternalName(cls.getCanonicalName()), "t");
mc.addParameter("CodedOutputStrea... | java | private MethodCode getWriteToMethodCode() {
MethodCode mc = new MethodCode();
mc.setName("writeTo");
mc.setReturnType("void");
mc.setScope(ClassCode.SCOPE_PUBLIC);
mc.addParameter(ClassHelper.getInternalName(cls.getCanonicalName()), "t");
mc.addParameter("CodedOutputStrea... | [
"private",
"MethodCode",
"getWriteToMethodCode",
"(",
")",
"{",
"MethodCode",
"mc",
"=",
"new",
"MethodCode",
"(",
")",
";",
"mc",
".",
"setName",
"(",
"\"writeTo\"",
")",
";",
"mc",
".",
"setReturnType",
"(",
"\"void\"",
")",
";",
"mc",
".",
"setScope",
... | Gets the write to method code.
@return the write to method code | [
"Gets",
"the",
"write",
"to",
"method",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L476-L517 |
29,251 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.getSizeMethodCode | private MethodCode getSizeMethodCode() {
MethodCode mc = new MethodCode();
mc.setName("size");
mc.setScope(ClassCode.SCOPE_PUBLIC);
mc.setReturnType("int");
mc.addParameter(ClassHelper.getInternalName(cls.getCanonicalName()), "t");
mc.addException("IOException");
... | java | private MethodCode getSizeMethodCode() {
MethodCode mc = new MethodCode();
mc.setName("size");
mc.setScope(ClassCode.SCOPE_PUBLIC);
mc.setReturnType("int");
mc.addParameter(ClassHelper.getInternalName(cls.getCanonicalName()), "t");
mc.addException("IOException");
... | [
"private",
"MethodCode",
"getSizeMethodCode",
"(",
")",
"{",
"MethodCode",
"mc",
"=",
"new",
"MethodCode",
"(",
")",
";",
"mc",
".",
"setName",
"(",
"\"size\"",
")",
";",
"mc",
".",
"setScope",
"(",
"ClassCode",
".",
"SCOPE_PUBLIC",
")",
";",
"mc",
".",
... | Gets the size method code.
@return the size method code | [
"Gets",
"the",
"size",
"method",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L524-L574 |
29,252 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java | CodeGenerator.getAccessByField | protected String getAccessByField(String target, Field field, Class<?> cls) {
if (field.getModifiers() == Modifier.PUBLIC) {
return target + ClassHelper.PACKAGE_SEPARATOR + field.getName();
}
// check if has getter method
String getter;
if ("boolean".equalsIgnoreCase(... | java | protected String getAccessByField(String target, Field field, Class<?> cls) {
if (field.getModifiers() == Modifier.PUBLIC) {
return target + ClassHelper.PACKAGE_SEPARATOR + field.getName();
}
// check if has getter method
String getter;
if ("boolean".equalsIgnoreCase(... | [
"protected",
"String",
"getAccessByField",
"(",
"String",
"target",
",",
"Field",
"field",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"if",
"(",
"field",
".",
"getModifiers",
"(",
")",
"==",
"Modifier",
".",
"PUBLIC",
")",
"{",
"return",
"target",
"... | get field access code.
@param target target instance name
@param field java field instance
@param cls mapped class
@return full field access java code | [
"get",
"field",
"access",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodeGenerator.java#L584-L615 |
29,253 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/CodePrinter.java | CodePrinter.printCode | public static void printCode(String code, String desc) {
System.out.println("--------------------------" + desc + " begin--------------------------");
System.out.println(code);
System.out.println("--------------------------" + desc + " end--------------------------");
} | java | public static void printCode(String code, String desc) {
System.out.println("--------------------------" + desc + " begin--------------------------");
System.out.println(code);
System.out.println("--------------------------" + desc + " end--------------------------");
} | [
"public",
"static",
"void",
"printCode",
"(",
"String",
"code",
",",
"String",
"desc",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"--------------------------\"",
"+",
"desc",
"+",
"\" begin--------------------------\"",
")",
";",
"System",
".",
"out"... | print code to console
@param code code in string
@param desc code description | [
"print",
"code",
"to",
"console"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/CodePrinter.java#L33-L37 |
29,254 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/P12Util.java | P12Util.getFirstPrivateKeyEntryFromP12InputStream | public static PrivateKeyEntry getFirstPrivateKeyEntryFromP12InputStream(final InputStream p12InputStream, final String password) throws KeyStoreException, IOException {
Objects.requireNonNull(password, "Password may be blank, but must not be null.");
final KeyStore keyStore = KeyStore.getInstance("PKCS... | java | public static PrivateKeyEntry getFirstPrivateKeyEntryFromP12InputStream(final InputStream p12InputStream, final String password) throws KeyStoreException, IOException {
Objects.requireNonNull(password, "Password may be blank, but must not be null.");
final KeyStore keyStore = KeyStore.getInstance("PKCS... | [
"public",
"static",
"PrivateKeyEntry",
"getFirstPrivateKeyEntryFromP12InputStream",
"(",
"final",
"InputStream",
"p12InputStream",
",",
"final",
"String",
"password",
")",
"throws",
"KeyStoreException",
",",
"IOException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"pass... | Returns the first private key entry found in the given keystore. If more than one private key is present, the
key that is returned is undefined.
@param p12InputStream an input stream for a PKCS#12 keystore
@param password the password to be used to load the keystore and its entries; may be blank, but must not be
{@cod... | [
"Returns",
"the",
"first",
"private",
"key",
"entry",
"found",
"in",
"the",
"given",
"keystore",
".",
"If",
"more",
"than",
"one",
"private",
"key",
"is",
"present",
"the",
"key",
"that",
"is",
"returned",
"is",
"undefined",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/P12Util.java#L56-L91 |
29,255 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/server/BaseHttp2Server.java | BaseHttp2Server.start | public Future<Void> start(final int port) {
final ChannelFuture channelFuture = this.bootstrap.bind(port);
this.allChannels.add(channelFuture.channel());
return channelFuture;
} | java | public Future<Void> start(final int port) {
final ChannelFuture channelFuture = this.bootstrap.bind(port);
this.allChannels.add(channelFuture.channel());
return channelFuture;
} | [
"public",
"Future",
"<",
"Void",
">",
"start",
"(",
"final",
"int",
"port",
")",
"{",
"final",
"ChannelFuture",
"channelFuture",
"=",
"this",
".",
"bootstrap",
".",
"bind",
"(",
"port",
")",
";",
"this",
".",
"allChannels",
".",
"add",
"(",
"channelFutur... | Starts this mock server and listens for traffic on the given port.
@param port the port to which this server should bind
@return a {@code Future} that will succeed when the server has bound to the given port and is ready to accept
traffic | [
"Starts",
"this",
"mock",
"server",
"and",
"listens",
"for",
"traffic",
"on",
"the",
"given",
"port",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/server/BaseHttp2Server.java#L119-L124 |
29,256 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/server/ServerChannelClassUtil.java | ServerChannelClassUtil.getServerSocketChannelClass | @SuppressWarnings("unchecked")
static Class<? extends ServerChannel> getServerSocketChannelClass(final EventLoopGroup eventLoopGroup) {
Objects.requireNonNull(eventLoopGroup);
final String serverSocketChannelClassName = SERVER_SOCKET_CHANNEL_CLASSES.get(eventLoopGroup.getClass().getName());
... | java | @SuppressWarnings("unchecked")
static Class<? extends ServerChannel> getServerSocketChannelClass(final EventLoopGroup eventLoopGroup) {
Objects.requireNonNull(eventLoopGroup);
final String serverSocketChannelClassName = SERVER_SOCKET_CHANNEL_CLASSES.get(eventLoopGroup.getClass().getName());
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"Class",
"<",
"?",
"extends",
"ServerChannel",
">",
"getServerSocketChannelClass",
"(",
"final",
"EventLoopGroup",
"eventLoopGroup",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"eventLoopGroup",
")",
... | Returns a server socket channel class suitable for specified event loop group.
@param eventLoopGroup the event loop group for which to identify an appropriate socket channel class; must not
be {@code null}
@return a server socket channel class suitable for use with the given event loop group
@throws IllegalArgumentE... | [
"Returns",
"a",
"server",
"socket",
"channel",
"class",
"suitable",
"for",
"specified",
"event",
"loop",
"group",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/server/ServerChannelClassUtil.java#L53-L68 |
29,257 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsChannelFactory.java | ApnsChannelFactory.create | @Override
public Future<Channel> create(final Promise<Channel> channelReadyPromise) {
final long delay = this.currentDelaySeconds.get();
channelReadyPromise.addListener(new GenericFutureListener<Future<Channel>>() {
@Override
public void operationComplete(final Future<Chann... | java | @Override
public Future<Channel> create(final Promise<Channel> channelReadyPromise) {
final long delay = this.currentDelaySeconds.get();
channelReadyPromise.addListener(new GenericFutureListener<Future<Channel>>() {
@Override
public void operationComplete(final Future<Chann... | [
"@",
"Override",
"public",
"Future",
"<",
"Channel",
">",
"create",
"(",
"final",
"Promise",
"<",
"Channel",
">",
"channelReadyPromise",
")",
"{",
"final",
"long",
"delay",
"=",
"this",
".",
"currentDelaySeconds",
".",
"get",
"(",
")",
";",
"channelReadyProm... | Creates and connects a new channel. The initial connection attempt may be delayed to accommodate exponential
back-off requirements.
@param channelReadyPromise the promise to be notified when a channel has been created and connected to the APNs
server
@return a future that will be notified once a channel has been crea... | [
"Creates",
"and",
"connects",
"a",
"new",
"channel",
".",
"The",
"initial",
"connection",
"attempt",
"may",
"be",
"delayed",
"to",
"accommodate",
"exponential",
"back",
"-",
"off",
"requirements",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsChannelFactory.java#L183-L239 |
29,258 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsChannelFactory.java | ApnsChannelFactory.destroy | @Override
public Future<Void> destroy(final Channel channel, final Promise<Void> promise) {
channel.close().addListener(new PromiseNotifier<>(promise));
return promise;
} | java | @Override
public Future<Void> destroy(final Channel channel, final Promise<Void> promise) {
channel.close().addListener(new PromiseNotifier<>(promise));
return promise;
} | [
"@",
"Override",
"public",
"Future",
"<",
"Void",
">",
"destroy",
"(",
"final",
"Channel",
"channel",
",",
"final",
"Promise",
"<",
"Void",
">",
"promise",
")",
"{",
"channel",
".",
"close",
"(",
")",
".",
"addListener",
"(",
"new",
"PromiseNotifier",
"<... | Destroys a channel by closing it.
@param channel the channel to destroy
@param promise the promise to notify when the channel has been destroyed
@return a future that will be notified when the channel has been destroyed | [
"Destroys",
"a",
"channel",
"by",
"closing",
"it",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsChannelFactory.java#L249-L253 |
29,259 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/auth/AuthenticationToken.java | AuthenticationToken.verifySignature | public boolean verifySignature(final ApnsVerificationKey verificationKey) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
if (!this.header.getKeyId().equals(verificationKey.getKeyId())) {
return false;
}
if (!this.claims.getIssuer().equals(verificationKey.... | java | public boolean verifySignature(final ApnsVerificationKey verificationKey) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
if (!this.header.getKeyId().equals(verificationKey.getKeyId())) {
return false;
}
if (!this.claims.getIssuer().equals(verificationKey.... | [
"public",
"boolean",
"verifySignature",
"(",
"final",
"ApnsVerificationKey",
"verificationKey",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"SignatureException",
"{",
"if",
"(",
"!",
"this",
".",
"header",
".",
"getKeyId",
"(",
")",
"... | Verifies the cryptographic signature of this authentication token.
@param verificationKey the verification key (public key) to be used to verify this token's signature
@return {@code true} if this token's signature was verified or {@code false} otherwise
@throws NoSuchAlgorithmException if the JVM doesn't support th... | [
"Verifies",
"the",
"cryptographic",
"signature",
"of",
"this",
"authentication",
"token",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/auth/AuthenticationToken.java#L222-L247 |
29,260 | relayrides/pushy | micrometer-metrics-listener/src/main/java/com/turo/pushy/apns/metrics/micrometer/MicrometerApnsClientMetricsListener.java | MicrometerApnsClientMetricsListener.handleWriteFailure | @Override
public void handleWriteFailure(final ApnsClient apnsClient, final long notificationId) {
this.notificationStartTimes.remove(notificationId);
this.writeFailures.increment();
} | java | @Override
public void handleWriteFailure(final ApnsClient apnsClient, final long notificationId) {
this.notificationStartTimes.remove(notificationId);
this.writeFailures.increment();
} | [
"@",
"Override",
"public",
"void",
"handleWriteFailure",
"(",
"final",
"ApnsClient",
"apnsClient",
",",
"final",
"long",
"notificationId",
")",
"{",
"this",
".",
"notificationStartTimes",
".",
"remove",
"(",
"notificationId",
")",
";",
"this",
".",
"writeFailures"... | Records a failed attempt to send a notification and updates metrics accordingly.
@param apnsClient the client that failed to write the notification; note that this is ignored by
{@code MicrometerApnsClientMetricsListener} instances, which should always be used for exactly one client
@param notificationId an opaque, un... | [
"Records",
"a",
"failed",
"attempt",
"to",
"send",
"a",
"notification",
"and",
"updates",
"metrics",
"accordingly",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/micrometer-metrics-listener/src/main/java/com/turo/pushy/apns/metrics/micrometer/MicrometerApnsClientMetricsListener.java#L183-L187 |
29,261 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/auth/ApnsVerificationKey.java | ApnsVerificationKey.loadFromInputStream | public static ApnsVerificationKey loadFromInputStream(final InputStream inputStream, final String teamId, final String keyId) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
final ECPublicKey verificationKey;
{
final String base64EncodedPublicKey;
{
... | java | public static ApnsVerificationKey loadFromInputStream(final InputStream inputStream, final String teamId, final String keyId) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
final ECPublicKey verificationKey;
{
final String base64EncodedPublicKey;
{
... | [
"public",
"static",
"ApnsVerificationKey",
"loadFromInputStream",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"String",
"teamId",
",",
"final",
"String",
"keyId",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{... | Loads a verification key from the given input stream.
@param inputStream the input stream from which to load the key
@param teamId the ten-character, Apple-issued identifier for the team to which the key belongs
@param keyId the ten-character, Apple-issued identitifier for the key itself
@return an APNs verification ... | [
"Loads",
"a",
"verification",
"key",
"from",
"the",
"given",
"input",
"stream",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/auth/ApnsVerificationKey.java#L131-L177 |
29,262 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/auth/ApnsSigningKey.java | ApnsSigningKey.loadFromInputStream | public static ApnsSigningKey loadFromInputStream(final InputStream inputStream, final String teamId, final String keyId) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
final ECPrivateKey signingKey;
{
final String base64EncodedPrivateKey;
{
fi... | java | public static ApnsSigningKey loadFromInputStream(final InputStream inputStream, final String teamId, final String keyId) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
final ECPrivateKey signingKey;
{
final String base64EncodedPrivateKey;
{
fi... | [
"public",
"static",
"ApnsSigningKey",
"loadFromInputStream",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"String",
"teamId",
",",
"final",
"String",
"keyId",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
... | Loads a signing key from the given input stream.
@param inputStream the input stream from which to load the key
@param teamId the ten-character, Apple-issued identifier for the team to which the key belongs
@param keyId the ten-character, Apple-issued identitifier for the key itself
@return an APNs signing key with t... | [
"Loads",
"a",
"signing",
"key",
"from",
"the",
"given",
"input",
"stream",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/auth/ApnsSigningKey.java#L124-L170 |
29,263 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/server/AcceptAllPushNotificationHandlerFactory.java | AcceptAllPushNotificationHandlerFactory.buildHandler | @Override
public PushNotificationHandler buildHandler(final SSLSession sslSession) {
return new PushNotificationHandler() {
@Override
public void handlePushNotification(final Http2Headers headers, final ByteBuf payload) {
// Accept everything unconditionally!
... | java | @Override
public PushNotificationHandler buildHandler(final SSLSession sslSession) {
return new PushNotificationHandler() {
@Override
public void handlePushNotification(final Http2Headers headers, final ByteBuf payload) {
// Accept everything unconditionally!
... | [
"@",
"Override",
"public",
"PushNotificationHandler",
"buildHandler",
"(",
"final",
"SSLSession",
"sslSession",
")",
"{",
"return",
"new",
"PushNotificationHandler",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"handlePushNotification",
"(",
"final",
"Http2Header... | Constructs a new push notification handler that unconditionally accepts all push notifications.
@param sslSession the SSL session associated with the channel for which this handler will handle notifications
@return a new "accept everything" push notification handler | [
"Constructs",
"a",
"new",
"push",
"notification",
"handler",
"that",
"unconditionally",
"accepts",
"all",
"push",
"notifications",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/server/AcceptAllPushNotificationHandlerFactory.java#L48-L57 |
29,264 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsChannelPool.java | ApnsChannelPool.release | void release(final Channel channel) {
if (this.executor.inEventLoop()) {
this.releaseWithinEventExecutor(channel);
} else {
this.executor.submit(new Runnable() {
@Override
public void run() {
ApnsChannelPool.this.releaseWithinEv... | java | void release(final Channel channel) {
if (this.executor.inEventLoop()) {
this.releaseWithinEventExecutor(channel);
} else {
this.executor.submit(new Runnable() {
@Override
public void run() {
ApnsChannelPool.this.releaseWithinEv... | [
"void",
"release",
"(",
"final",
"Channel",
"channel",
")",
"{",
"if",
"(",
"this",
".",
"executor",
".",
"inEventLoop",
"(",
")",
")",
"{",
"this",
".",
"releaseWithinEventExecutor",
"(",
"channel",
")",
";",
"}",
"else",
"{",
"this",
".",
"executor",
... | Returns a previously-acquired channel to the pool.
@param channel the channel to return to the pool | [
"Returns",
"a",
"previously",
"-",
"acquired",
"channel",
"to",
"the",
"pool",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsChannelPool.java#L205-L216 |
29,265 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsChannelPool.java | ApnsChannelPool.close | public Future<Void> close() {
return this.allChannels.close().addListener(new GenericFutureListener<Future<Void>>() {
@Override
public void operationComplete(final Future<Void> future) throws Exception {
ApnsChannelPool.this.isClosed = true;
if (ApnsChann... | java | public Future<Void> close() {
return this.allChannels.close().addListener(new GenericFutureListener<Future<Void>>() {
@Override
public void operationComplete(final Future<Void> future) throws Exception {
ApnsChannelPool.this.isClosed = true;
if (ApnsChann... | [
"public",
"Future",
"<",
"Void",
">",
"close",
"(",
")",
"{",
"return",
"this",
".",
"allChannels",
".",
"close",
"(",
")",
".",
"addListener",
"(",
"new",
"GenericFutureListener",
"<",
"Future",
"<",
"Void",
">",
">",
"(",
")",
"{",
"@",
"Override",
... | Shuts down this channel pool and releases all retained resources.
@return a {@code Future} that will be completed when all resources held by this pool have been released | [
"Shuts",
"down",
"this",
"channel",
"pool",
"and",
"releases",
"all",
"retained",
"resources",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsChannelPool.java#L256-L271 |
29,266 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/server/BaseHttp2ServerBuilder.java | BaseHttp2ServerBuilder.build | public T build() throws SSLException {
final SslContext sslContext;
{
final SslProvider sslProvider;
if (OpenSsl.isAvailable()) {
log.info("Native SSL provider is available; will use native provider.");
sslProvider = SslProvider.OPENSSL;
... | java | public T build() throws SSLException {
final SslContext sslContext;
{
final SslProvider sslProvider;
if (OpenSsl.isAvailable()) {
log.info("Native SSL provider is available; will use native provider.");
sslProvider = SslProvider.OPENSSL;
... | [
"public",
"T",
"build",
"(",
")",
"throws",
"SSLException",
"{",
"final",
"SslContext",
"sslContext",
";",
"{",
"final",
"SslProvider",
"sslProvider",
";",
"if",
"(",
"OpenSsl",
".",
"isAvailable",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Native SSL... | Constructs a new server with the previously-set configuration.
@return a new server instance with the previously-set configuration
@throws SSLException if an SSL context could not be created for the new server for any reason
@since 0.8 | [
"Constructs",
"a",
"new",
"server",
"with",
"the",
"previously",
"-",
"set",
"configuration",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/server/BaseHttp2ServerBuilder.java#L285-L340 |
29,267 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ClientChannelClassUtil.java | ClientChannelClassUtil.getSocketChannelClass | static Class<? extends SocketChannel> getSocketChannelClass(final EventLoopGroup eventLoopGroup) {
Objects.requireNonNull(eventLoopGroup);
final String socketChannelClassName = SOCKET_CHANNEL_CLASSES.get(eventLoopGroup.getClass().getName());
if (socketChannelClassName == null) {
th... | java | static Class<? extends SocketChannel> getSocketChannelClass(final EventLoopGroup eventLoopGroup) {
Objects.requireNonNull(eventLoopGroup);
final String socketChannelClassName = SOCKET_CHANNEL_CLASSES.get(eventLoopGroup.getClass().getName());
if (socketChannelClassName == null) {
th... | [
"static",
"Class",
"<",
"?",
"extends",
"SocketChannel",
">",
"getSocketChannelClass",
"(",
"final",
"EventLoopGroup",
"eventLoopGroup",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"eventLoopGroup",
")",
";",
"final",
"String",
"socketChannelClassName",
"=",
"S... | Returns a socket channel class suitable for specified event loop group.
@param eventLoopGroup the event loop group for which to identify an appropriate socket channel class; must not
be {@code null}
@return a socket channel class suitable for use with the given event loop group
@throws IllegalArgumentException in ca... | [
"Returns",
"a",
"socket",
"channel",
"class",
"suitable",
"for",
"specified",
"event",
"loop",
"group",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ClientChannelClassUtil.java#L60-L74 |
29,268 | relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ClientChannelClassUtil.java | ClientChannelClassUtil.getDatagramChannelClass | static Class<? extends DatagramChannel> getDatagramChannelClass(final EventLoopGroup eventLoopGroup) {
Objects.requireNonNull(eventLoopGroup);
final String datagramChannelClassName = DATAGRAM_CHANNEL_CLASSES.get(eventLoopGroup.getClass().getName());
if (datagramChannelClassName == null) {
... | java | static Class<? extends DatagramChannel> getDatagramChannelClass(final EventLoopGroup eventLoopGroup) {
Objects.requireNonNull(eventLoopGroup);
final String datagramChannelClassName = DATAGRAM_CHANNEL_CLASSES.get(eventLoopGroup.getClass().getName());
if (datagramChannelClassName == null) {
... | [
"static",
"Class",
"<",
"?",
"extends",
"DatagramChannel",
">",
"getDatagramChannelClass",
"(",
"final",
"EventLoopGroup",
"eventLoopGroup",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"eventLoopGroup",
")",
";",
"final",
"String",
"datagramChannelClassName",
"="... | Returns a datagram channel class suitable for specified event loop group.
@param eventLoopGroup the event loop group for which to identify an appropriate datagram channel class; must not
be {@code null}
@return a datagram channel class suitable for use with the given event loop group
@throws IllegalArgumentException... | [
"Returns",
"a",
"datagram",
"channel",
"class",
"suitable",
"for",
"specified",
"event",
"loop",
"group",
"."
] | 1f6f9a0e07d785c815d74c2320a8d87c80231d36 | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ClientChannelClassUtil.java#L86-L100 |
29,269 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/screen/AbstractScreen.java | AbstractScreen.setCursorPosition | @Override
public void setCursorPosition(TerminalPosition position) {
if(position == null) {
//Skip any validation checks if we just want to hide the cursor
this.cursorPosition = null;
return;
}
if(position.getColumn() < 0) {
position = position... | java | @Override
public void setCursorPosition(TerminalPosition position) {
if(position == null) {
//Skip any validation checks if we just want to hide the cursor
this.cursorPosition = null;
return;
}
if(position.getColumn() < 0) {
position = position... | [
"@",
"Override",
"public",
"void",
"setCursorPosition",
"(",
"TerminalPosition",
"position",
")",
"{",
"if",
"(",
"position",
"==",
"null",
")",
"{",
"//Skip any validation checks if we just want to hide the cursor",
"this",
".",
"cursorPosition",
"=",
"null",
";",
"r... | Moves the current cursor position or hides it. If the cursor is hidden and given a new position, it will be
visible after this method call.
@param position 0-indexed column and row numbers of the new position, or if {@code null}, hides the cursor | [
"Moves",
"the",
"current",
"cursor",
"position",
"or",
"hides",
"it",
".",
"If",
"the",
"cursor",
"is",
"hidden",
"and",
"given",
"a",
"new",
"position",
"it",
"will",
"be",
"visible",
"after",
"this",
"method",
"call",
"."
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/screen/AbstractScreen.java#L89-L109 |
29,270 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/screen/AbstractScreen.java | AbstractScreen.scrollLines | @Override
public void scrollLines(int firstLine, int lastLine, int distance) {
getBackBuffer().scrollLines(firstLine, lastLine, distance);
} | java | @Override
public void scrollLines(int firstLine, int lastLine, int distance) {
getBackBuffer().scrollLines(firstLine, lastLine, distance);
} | [
"@",
"Override",
"public",
"void",
"scrollLines",
"(",
"int",
"firstLine",
",",
"int",
"lastLine",
",",
"int",
"distance",
")",
"{",
"getBackBuffer",
"(",
")",
".",
"scrollLines",
"(",
"firstLine",
",",
"lastLine",
",",
"distance",
")",
";",
"}"
] | Performs the scrolling on its back-buffer. | [
"Performs",
"the",
"scrolling",
"on",
"its",
"back",
"-",
"buffer",
"."
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/screen/AbstractScreen.java#L265-L268 |
29,271 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java | StreamBasedTerminal.waitForCursorPositionReport | synchronized TerminalPosition waitForCursorPositionReport() throws IOException {
long startTime = System.currentTimeMillis();
TerminalPosition cursorPosition = lastReportedCursorPosition;
while(cursorPosition == null) {
if(System.currentTimeMillis() - startTime > 5000) {
... | java | synchronized TerminalPosition waitForCursorPositionReport() throws IOException {
long startTime = System.currentTimeMillis();
TerminalPosition cursorPosition = lastReportedCursorPosition;
while(cursorPosition == null) {
if(System.currentTimeMillis() - startTime > 5000) {
... | [
"synchronized",
"TerminalPosition",
"waitForCursorPositionReport",
"(",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"TerminalPosition",
"cursorPosition",
"=",
"lastReportedCursorPosition",
";",
"while",
... | Waits for up to 5 seconds for a terminal cursor position report to appear in the input stream. If the timeout
expires, it will return null. You should have sent the cursor position query already before
calling this method.
@return Current position of the cursor, or null if the terminal didn't report it in time.
@throws... | [
"Waits",
"for",
"up",
"to",
"5",
"seconds",
"for",
"a",
"terminal",
"cursor",
"position",
"report",
"to",
"appear",
"in",
"the",
"input",
"stream",
".",
"If",
"the",
"timeout",
"expires",
"it",
"will",
"return",
"null",
".",
"You",
"should",
"have",
"sen... | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java#L167-L185 |
29,272 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/MessageDialogBuilder.java | MessageDialogBuilder.setExtraWindowHints | public MessageDialogBuilder setExtraWindowHints(Collection<Window.Hint> extraWindowHints) {
this.extraWindowHints.clear();
this.extraWindowHints.addAll(extraWindowHints);
return this;
} | java | public MessageDialogBuilder setExtraWindowHints(Collection<Window.Hint> extraWindowHints) {
this.extraWindowHints.clear();
this.extraWindowHints.addAll(extraWindowHints);
return this;
} | [
"public",
"MessageDialogBuilder",
"setExtraWindowHints",
"(",
"Collection",
"<",
"Window",
".",
"Hint",
">",
"extraWindowHints",
")",
"{",
"this",
".",
"extraWindowHints",
".",
"clear",
"(",
")",
";",
"this",
".",
"extraWindowHints",
".",
"addAll",
"(",
"extraWi... | Assigns a set of extra window hints that you want the built dialog to have
@param extraWindowHints Window hints to assign to the window in addition to the ones the builder will put
@return Itself | [
"Assigns",
"a",
"set",
"of",
"extra",
"window",
"hints",
"that",
"you",
"want",
"the",
"built",
"dialog",
"to",
"have"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/MessageDialogBuilder.java#L95-L99 |
29,273 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java | WaitingDialog.showDialog | public static WaitingDialog showDialog(WindowBasedTextGUI textGUI, String title, String text) {
WaitingDialog waitingDialog = createDialog(title, text);
waitingDialog.showDialog(textGUI, false);
return waitingDialog;
} | java | public static WaitingDialog showDialog(WindowBasedTextGUI textGUI, String title, String text) {
WaitingDialog waitingDialog = createDialog(title, text);
waitingDialog.showDialog(textGUI, false);
return waitingDialog;
} | [
"public",
"static",
"WaitingDialog",
"showDialog",
"(",
"WindowBasedTextGUI",
"textGUI",
",",
"String",
"title",
",",
"String",
"text",
")",
"{",
"WaitingDialog",
"waitingDialog",
"=",
"createDialog",
"(",
"title",
",",
"text",
")",
";",
"waitingDialog",
".",
"s... | Creates and displays a waiting dialog without blocking for it to finish
@param textGUI GUI to add the dialog to
@param title Title of the waiting dialog
@param text Text to display on the waiting dialog
@return Created waiting dialog | [
"Creates",
"and",
"displays",
"a",
"waiting",
"dialog",
"without",
"blocking",
"for",
"it",
"to",
"finish"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java#L76-L80 |
29,274 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/GridLayout.java | GridLayout.createHorizontallyFilledLayoutData | public static LayoutData createHorizontallyFilledLayoutData(int horizontalSpan) {
return createLayoutData(
Alignment.FILL,
Alignment.CENTER,
true,
false,
horizontalSpan,
1);
} | java | public static LayoutData createHorizontallyFilledLayoutData(int horizontalSpan) {
return createLayoutData(
Alignment.FILL,
Alignment.CENTER,
true,
false,
horizontalSpan,
1);
} | [
"public",
"static",
"LayoutData",
"createHorizontallyFilledLayoutData",
"(",
"int",
"horizontalSpan",
")",
"{",
"return",
"createLayoutData",
"(",
"Alignment",
".",
"FILL",
",",
"Alignment",
".",
"CENTER",
",",
"true",
",",
"false",
",",
"horizontalSpan",
",",
"1"... | This is a shortcut method that will create a grid layout data object that will expand its cell as much as is can
horizontally and make the component occupy the whole area horizontally and center it vertically
@param horizontalSpan How many cells to span horizontally
@return Layout data object with the specified span an... | [
"This",
"is",
"a",
"shortcut",
"method",
"that",
"will",
"create",
"a",
"grid",
"layout",
"data",
"object",
"that",
"will",
"expand",
"its",
"cell",
"as",
"much",
"as",
"is",
"can",
"horizontally",
"and",
"make",
"the",
"component",
"occupy",
"the",
"whole... | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/GridLayout.java#L183-L191 |
29,275 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/GridLayout.java | GridLayout.createHorizontallyEndAlignedLayoutData | public static LayoutData createHorizontallyEndAlignedLayoutData(int horizontalSpan) {
return createLayoutData(
Alignment.END,
Alignment.CENTER,
true,
false,
horizontalSpan,
1);
} | java | public static LayoutData createHorizontallyEndAlignedLayoutData(int horizontalSpan) {
return createLayoutData(
Alignment.END,
Alignment.CENTER,
true,
false,
horizontalSpan,
1);
} | [
"public",
"static",
"LayoutData",
"createHorizontallyEndAlignedLayoutData",
"(",
"int",
"horizontalSpan",
")",
"{",
"return",
"createLayoutData",
"(",
"Alignment",
".",
"END",
",",
"Alignment",
".",
"CENTER",
",",
"true",
",",
"false",
",",
"horizontalSpan",
",",
... | This is a shortcut method that will create a grid layout data object that will expand its cell as much as is can
vertically and make the component occupy the whole area vertically and center it horizontally
@param horizontalSpan How many cells to span vertically
@return Layout data object with the specified span and ve... | [
"This",
"is",
"a",
"shortcut",
"method",
"that",
"will",
"create",
"a",
"grid",
"layout",
"data",
"object",
"that",
"will",
"expand",
"its",
"cell",
"as",
"much",
"as",
"is",
"can",
"vertically",
"and",
"make",
"the",
"component",
"occupy",
"the",
"whole",... | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/GridLayout.java#L199-L207 |
29,276 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/CheckBox.java | CheckBox.setChecked | public synchronized CheckBox setChecked(final boolean checked) {
this.checked = checked;
runOnGUIThreadIfExistsOtherwiseRunDirect(new Runnable() {
@Override
public void run() {
for(Listener listener : listeners) {
listener.onStatusChanged(check... | java | public synchronized CheckBox setChecked(final boolean checked) {
this.checked = checked;
runOnGUIThreadIfExistsOtherwiseRunDirect(new Runnable() {
@Override
public void run() {
for(Listener listener : listeners) {
listener.onStatusChanged(check... | [
"public",
"synchronized",
"CheckBox",
"setChecked",
"(",
"final",
"boolean",
"checked",
")",
"{",
"this",
".",
"checked",
"=",
"checked",
";",
"runOnGUIThreadIfExistsOtherwiseRunDirect",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"... | Programmatically updated the check box to a particular checked state
@param checked If {@code true}, the check box will be set to toggled on, otherwise {@code false}
@return Itself | [
"Programmatically",
"updated",
"the",
"check",
"box",
"to",
"a",
"particular",
"checked",
"state"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/CheckBox.java#L83-L95 |
29,277 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/CheckBox.java | CheckBox.setLabel | public synchronized CheckBox setLabel(String label) {
if(label == null) {
throw new IllegalArgumentException("Cannot set CheckBox label to null");
}
this.label = label;
invalidate();
return this;
} | java | public synchronized CheckBox setLabel(String label) {
if(label == null) {
throw new IllegalArgumentException("Cannot set CheckBox label to null");
}
this.label = label;
invalidate();
return this;
} | [
"public",
"synchronized",
"CheckBox",
"setLabel",
"(",
"String",
"label",
")",
"{",
"if",
"(",
"label",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot set CheckBox label to null\"",
")",
";",
"}",
"this",
".",
"label",
"=",
... | Updates the label of the checkbox
@param label New label to assign to the check box
@return Itself | [
"Updates",
"the",
"label",
"of",
"the",
"checkbox"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/CheckBox.java#L120-L127 |
29,278 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/CheckBox.java | CheckBox.addListener | public CheckBox addListener(Listener listener) {
if(listener != null && !listeners.contains(listener)) {
listeners.add(listener);
}
return this;
} | java | public CheckBox addListener(Listener listener) {
if(listener != null && !listeners.contains(listener)) {
listeners.add(listener);
}
return this;
} | [
"public",
"CheckBox",
"addListener",
"(",
"Listener",
"listener",
")",
"{",
"if",
"(",
"listener",
"!=",
"null",
"&&",
"!",
"listeners",
".",
"contains",
"(",
"listener",
")",
")",
"{",
"listeners",
".",
"add",
"(",
"listener",
")",
";",
"}",
"return",
... | Adds a listener to this check box so that it will be notificed on certain user actions
@param listener Listener to fire events on
@return Itself | [
"Adds",
"a",
"listener",
"to",
"this",
"check",
"box",
"so",
"that",
"it",
"will",
"be",
"notificed",
"on",
"certain",
"user",
"actions"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/CheckBox.java#L142-L147 |
29,279 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/swing/GraphicalTerminalImplementation.java | GraphicalTerminalImplementation.startBlinkTimer | synchronized void startBlinkTimer() {
if(blinkTimer != null) {
// Already on!
return;
}
blinkTimer = new Timer("LanternaTerminalBlinkTimer", true);
blinkTimer.schedule(new TimerTask() {
@Override
public void run() {
blinkOn ... | java | synchronized void startBlinkTimer() {
if(blinkTimer != null) {
// Already on!
return;
}
blinkTimer = new Timer("LanternaTerminalBlinkTimer", true);
blinkTimer.schedule(new TimerTask() {
@Override
public void run() {
blinkOn ... | [
"synchronized",
"void",
"startBlinkTimer",
"(",
")",
"{",
"if",
"(",
"blinkTimer",
"!=",
"null",
")",
"{",
"// Already on!",
"return",
";",
"}",
"blinkTimer",
"=",
"new",
"Timer",
"(",
"\"LanternaTerminalBlinkTimer\"",
",",
"true",
")",
";",
"blinkTimer",
".",... | Start the timer that triggers blinking | [
"Start",
"the",
"timer",
"that",
"triggers",
"blinking"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/GraphicalTerminalImplementation.java#L202-L217 |
29,280 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/swing/GraphicalTerminalImplementation.java | GraphicalTerminalImplementation.getPreferredSize | synchronized Dimension getPreferredSize() {
return new Dimension(getFontWidth() * virtualTerminal.getTerminalSize().getColumns(),
getFontHeight() * virtualTerminal.getTerminalSize().getRows());
} | java | synchronized Dimension getPreferredSize() {
return new Dimension(getFontWidth() * virtualTerminal.getTerminalSize().getColumns(),
getFontHeight() * virtualTerminal.getTerminalSize().getRows());
} | [
"synchronized",
"Dimension",
"getPreferredSize",
"(",
")",
"{",
"return",
"new",
"Dimension",
"(",
"getFontWidth",
"(",
")",
"*",
"virtualTerminal",
".",
"getTerminalSize",
"(",
")",
".",
"getColumns",
"(",
")",
",",
"getFontHeight",
"(",
")",
"*",
"virtualTer... | Calculates the preferred size of this terminal
@return Preferred size of this terminal | [
"Calculates",
"the",
"preferred",
"size",
"of",
"this",
"terminal"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/GraphicalTerminalImplementation.java#L238-L241 |
29,281 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/swing/GraphicalTerminalImplementation.java | GraphicalTerminalImplementation.clearBackBuffer | private void clearBackBuffer() {
// Manually clear the backbuffer
if(backbuffer != null) {
Graphics2D graphics = backbuffer.createGraphics();
Color backgroundColor = colorConfiguration.toAWTColor(TextColor.ANSI.DEFAULT, false, false);
graphics.setColor(backgroundColor... | java | private void clearBackBuffer() {
// Manually clear the backbuffer
if(backbuffer != null) {
Graphics2D graphics = backbuffer.createGraphics();
Color backgroundColor = colorConfiguration.toAWTColor(TextColor.ANSI.DEFAULT, false, false);
graphics.setColor(backgroundColor... | [
"private",
"void",
"clearBackBuffer",
"(",
")",
"{",
"// Manually clear the backbuffer",
"if",
"(",
"backbuffer",
"!=",
"null",
")",
"{",
"Graphics2D",
"graphics",
"=",
"backbuffer",
".",
"createGraphics",
"(",
")",
";",
"Color",
"backgroundColor",
"=",
"colorConf... | Clears out the back buffer and the resets the visual state so next paint operation will do a full repaint of
everything | [
"Clears",
"out",
"the",
"back",
"buffer",
"and",
"the",
"resets",
"the",
"visual",
"state",
"so",
"next",
"paint",
"operation",
"will",
"do",
"a",
"full",
"repaint",
"of",
"everything"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/GraphicalTerminalImplementation.java#L677-L686 |
29,282 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java | SimpleTheme.makeTheme | public static SimpleTheme makeTheme(
boolean activeIsBold,
TextColor baseForeground,
TextColor baseBackground,
TextColor editableForeground,
TextColor editableBackground,
TextColor selectedForeground,
TextColor selectedBackground,
... | java | public static SimpleTheme makeTheme(
boolean activeIsBold,
TextColor baseForeground,
TextColor baseBackground,
TextColor editableForeground,
TextColor editableBackground,
TextColor selectedForeground,
TextColor selectedBackground,
... | [
"public",
"static",
"SimpleTheme",
"makeTheme",
"(",
"boolean",
"activeIsBold",
",",
"TextColor",
"baseForeground",
",",
"TextColor",
"baseBackground",
",",
"TextColor",
"editableForeground",
",",
"TextColor",
"editableBackground",
",",
"TextColor",
"selectedForeground",
... | Helper method that will quickly setup a new theme with some sensible component overrides.
@param activeIsBold Should focused components also use bold SGR style?
@param baseForeground The base foreground color of the theme
@param baseBackground The base background color of the theme
@param editableForeground Foreground ... | [
"Helper",
"method",
"that",
"will",
"quickly",
"setup",
"a",
"new",
"theme",
"with",
"some",
"sensible",
"component",
"overrides",
"."
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java#L49-L96 |
29,283 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java | SimpleTheme.addOverride | public synchronized Definition addOverride(Class<?> clazz, TextColor foreground, TextColor background, SGR... styles) {
Definition definition = new Definition(new Style(foreground, background, styles));
overrideDefinitions.put(clazz, definition);
return definition;
} | java | public synchronized Definition addOverride(Class<?> clazz, TextColor foreground, TextColor background, SGR... styles) {
Definition definition = new Definition(new Style(foreground, background, styles));
overrideDefinitions.put(clazz, definition);
return definition;
} | [
"public",
"synchronized",
"Definition",
"addOverride",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"TextColor",
"foreground",
",",
"TextColor",
"background",
",",
"SGR",
"...",
"styles",
")",
"{",
"Definition",
"definition",
"=",
"new",
"Definition",
"(",
"new"... | Adds an override for a particular class, or overwrites a previously defined override.
@param clazz Class to override the theme for
@param foreground Color to use as the foreground color for this override style
@param background Color to use as the background color for this override style
@param styles SGR styles to app... | [
"Adds",
"an",
"override",
"for",
"a",
"particular",
"class",
"or",
"overwrites",
"a",
"previously",
"defined",
"override",
"."
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java#L138-L142 |
29,284 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java | TableModel.getRows | public synchronized List<List<V>> getRows() {
List<List<V>> copy = new ArrayList<List<V>>();
for(List<V> row: rows) {
copy.add(new ArrayList<V>(row));
}
return copy;
} | java | public synchronized List<List<V>> getRows() {
List<List<V>> copy = new ArrayList<List<V>>();
for(List<V> row: rows) {
copy.add(new ArrayList<V>(row));
}
return copy;
} | [
"public",
"synchronized",
"List",
"<",
"List",
"<",
"V",
">",
">",
"getRows",
"(",
")",
"{",
"List",
"<",
"List",
"<",
"V",
">>",
"copy",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"V",
">",
">",
"(",
")",
";",
"for",
"(",
"List",
"<",
"V",
"... | Returns all rows in the model as a list of lists containing the data as elements
@return All rows in the model as a list of lists containing the data as elements | [
"Returns",
"all",
"rows",
"in",
"the",
"model",
"as",
"a",
"list",
"of",
"lists",
"containing",
"the",
"data",
"as",
"elements"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java#L111-L117 |
29,285 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java | TableModel.insertRow | public synchronized TableModel<V> insertRow(int index, Collection<V> values) {
ArrayList<V> list = new ArrayList<V>(values);
rows.add(index, list);
for(Listener<V> listener: listeners) {
listener.onRowAdded(this, index);
}
return this;
} | java | public synchronized TableModel<V> insertRow(int index, Collection<V> values) {
ArrayList<V> list = new ArrayList<V>(values);
rows.add(index, list);
for(Listener<V> listener: listeners) {
listener.onRowAdded(this, index);
}
return this;
} | [
"public",
"synchronized",
"TableModel",
"<",
"V",
">",
"insertRow",
"(",
"int",
"index",
",",
"Collection",
"<",
"V",
">",
"values",
")",
"{",
"ArrayList",
"<",
"V",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"V",
">",
"(",
"values",
")",
";",
"rows"... | Inserts a new row to the table model at a particular index
@param index Index the new row should have, 0 means the first row and <i>row count</i> will append the row at the
end
@param values Data to associate with the new row, mapped column by column in order
@return Itself | [
"Inserts",
"a",
"new",
"row",
"to",
"the",
"table",
"model",
"at",
"a",
"particular",
"index"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java#L163-L170 |
29,286 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java | TableModel.removeRow | public synchronized TableModel<V> removeRow(int index) {
List<V> removedRow = rows.remove(index);
for(Listener<V> listener: listeners) {
listener.onRowRemoved(this, index, removedRow);
}
return this;
} | java | public synchronized TableModel<V> removeRow(int index) {
List<V> removedRow = rows.remove(index);
for(Listener<V> listener: listeners) {
listener.onRowRemoved(this, index, removedRow);
}
return this;
} | [
"public",
"synchronized",
"TableModel",
"<",
"V",
">",
"removeRow",
"(",
"int",
"index",
")",
"{",
"List",
"<",
"V",
">",
"removedRow",
"=",
"rows",
".",
"remove",
"(",
"index",
")",
";",
"for",
"(",
"Listener",
"<",
"V",
">",
"listener",
":",
"liste... | Removes a row at a particular index from the table model
@param index Index of the row to remove
@return Itself | [
"Removes",
"a",
"row",
"at",
"a",
"particular",
"index",
"from",
"the",
"table",
"model"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java#L177-L183 |
29,287 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java | TableModel.setColumnLabel | public synchronized TableModel<V> setColumnLabel(int index, String newLabel) {
columns.set(index, newLabel);
return this;
} | java | public synchronized TableModel<V> setColumnLabel(int index, String newLabel) {
columns.set(index, newLabel);
return this;
} | [
"public",
"synchronized",
"TableModel",
"<",
"V",
">",
"setColumnLabel",
"(",
"int",
"index",
",",
"String",
"newLabel",
")",
"{",
"columns",
".",
"set",
"(",
"index",
",",
"newLabel",
")",
";",
"return",
"this",
";",
"}"
] | Updates the label of a column header
@param index Index of the column to update the header label for
@param newLabel New label to assign to the column header
@return Itself | [
"Updates",
"the",
"label",
"of",
"a",
"column",
"header"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java#L211-L214 |
29,288 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java | TableModel.removeColumn | public synchronized TableModel<V> removeColumn(int index) {
String removedColumnHeader = columns.remove(index);
List<V> removedColumn = new ArrayList<V>();
for(List<V> row : rows) {
removedColumn.add(row.remove(index));
}
for(Listener<V> listener: listeners) {
... | java | public synchronized TableModel<V> removeColumn(int index) {
String removedColumnHeader = columns.remove(index);
List<V> removedColumn = new ArrayList<V>();
for(List<V> row : rows) {
removedColumn.add(row.remove(index));
}
for(Listener<V> listener: listeners) {
... | [
"public",
"synchronized",
"TableModel",
"<",
"V",
">",
"removeColumn",
"(",
"int",
"index",
")",
"{",
"String",
"removedColumnHeader",
"=",
"columns",
".",
"remove",
"(",
"index",
")",
";",
"List",
"<",
"V",
">",
"removedColumn",
"=",
"new",
"ArrayList",
"... | Removes a column from the table model
@param index Index of the column to remove
@return Itself | [
"Removes",
"a",
"column",
"from",
"the",
"table",
"model"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java#L266-L276 |
29,289 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorPalette.java | TerminalEmulatorPalette.get | public Color get(TextColor.ANSI color, boolean isForeground, boolean useBrightTones) {
if(useBrightTones) {
switch(color) {
case BLACK:
return brightBlack;
case BLUE:
return brightBlue;
case CYAN:
... | java | public Color get(TextColor.ANSI color, boolean isForeground, boolean useBrightTones) {
if(useBrightTones) {
switch(color) {
case BLACK:
return brightBlack;
case BLUE:
return brightBlue;
case CYAN:
... | [
"public",
"Color",
"get",
"(",
"TextColor",
".",
"ANSI",
"color",
",",
"boolean",
"isForeground",
",",
"boolean",
"useBrightTones",
")",
"{",
"if",
"(",
"useBrightTones",
")",
"{",
"switch",
"(",
"color",
")",
"{",
"case",
"BLACK",
":",
"return",
"brightBl... | Returns the AWT color from this palette given an ANSI color and two hints for if we are looking for a background
color and if we want to use the bright version.
@param color Which ANSI color we want to extract
@param isForeground Is this color we extract going to be used as a background color?
@param useBrightTones If ... | [
"Returns",
"the",
"AWT",
"color",
"from",
"this",
"palette",
"given",
"an",
"ANSI",
"color",
"and",
"two",
"hints",
"for",
"if",
"we",
"are",
"looking",
"for",
"a",
"background",
"color",
"and",
"if",
"we",
"want",
"to",
"use",
"the",
"bright",
"version"... | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorPalette.java#L284-L330 |
29,290 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/InteractableLookupMap.java | InteractableLookupMap.add | @SuppressWarnings("ConstantConditions")
public synchronized void add(Interactable interactable) {
TerminalPosition topLeft = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER);
TerminalSize size = interactable.getSize();
interactables.add(interactable);
int index = interactabl... | java | @SuppressWarnings("ConstantConditions")
public synchronized void add(Interactable interactable) {
TerminalPosition topLeft = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER);
TerminalSize size = interactable.getSize();
interactables.add(interactable);
int index = interactabl... | [
"@",
"SuppressWarnings",
"(",
"\"ConstantConditions\"",
")",
"public",
"synchronized",
"void",
"add",
"(",
"Interactable",
"interactable",
")",
"{",
"TerminalPosition",
"topLeft",
"=",
"interactable",
".",
"toBasePane",
"(",
"TerminalPosition",
".",
"TOP_LEFT_CORNER",
... | Adds an interactable component to the lookup map
@param interactable Interactable to add to the lookup map | [
"Adds",
"an",
"interactable",
"component",
"to",
"the",
"lookup",
"map"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/InteractableLookupMap.java#L59-L74 |
29,291 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/InteractableLookupMap.java | InteractableLookupMap.getInteractableAt | public synchronized Interactable getInteractableAt(TerminalPosition position) {
if (position.getRow() < 0 || position.getColumn() < 0) {
return null;
}
if(position.getRow() >= lookupMap.length) {
return null;
}
else if(position.getColumn() >= lookupMap[0].... | java | public synchronized Interactable getInteractableAt(TerminalPosition position) {
if (position.getRow() < 0 || position.getColumn() < 0) {
return null;
}
if(position.getRow() >= lookupMap.length) {
return null;
}
else if(position.getColumn() >= lookupMap[0].... | [
"public",
"synchronized",
"Interactable",
"getInteractableAt",
"(",
"TerminalPosition",
"position",
")",
"{",
"if",
"(",
"position",
".",
"getRow",
"(",
")",
"<",
"0",
"||",
"position",
".",
"getColumn",
"(",
")",
"<",
"0",
")",
"{",
"return",
"null",
";",... | Looks up what interactable component is as a particular location in the map
@param position Position to look up
@return The {@code Interactable} component at the specified location or {@code null} if there's nothing there | [
"Looks",
"up",
"what",
"interactable",
"component",
"is",
"as",
"a",
"particular",
"location",
"in",
"the",
"map"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/InteractableLookupMap.java#L81-L95 |
29,292 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/ListSelectDialogBuilder.java | ListSelectDialogBuilder.addListItems | public ListSelectDialogBuilder<T> addListItems(T... items) {
this.content.addAll(Arrays.asList(items));
return this;
} | java | public ListSelectDialogBuilder<T> addListItems(T... items) {
this.content.addAll(Arrays.asList(items));
return this;
} | [
"public",
"ListSelectDialogBuilder",
"<",
"T",
">",
"addListItems",
"(",
"T",
"...",
"items",
")",
"{",
"this",
".",
"content",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"items",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a list of items to the list box at the end, in the order they are passed in
@param items Items to add to the list box
@return Itself | [
"Adds",
"a",
"list",
"of",
"items",
"to",
"the",
"list",
"box",
"at",
"the",
"end",
"in",
"the",
"order",
"they",
"are",
"passed",
"in"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/ListSelectDialogBuilder.java#L115-L118 |
29,293 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java | CheckBoxList.addItem | public synchronized CheckBoxList<V> addItem(V object, boolean checkedState) {
itemStatus.add(checkedState);
return super.addItem(object);
} | java | public synchronized CheckBoxList<V> addItem(V object, boolean checkedState) {
itemStatus.add(checkedState);
return super.addItem(object);
} | [
"public",
"synchronized",
"CheckBoxList",
"<",
"V",
">",
"addItem",
"(",
"V",
"object",
",",
"boolean",
"checkedState",
")",
"{",
"itemStatus",
".",
"add",
"(",
"checkedState",
")",
";",
"return",
"super",
".",
"addItem",
"(",
"object",
")",
";",
"}"
] | Adds an item to the checkbox list with an explicit checked status
@param object Object to add to the list
@param checkedState If <code>true</code>, the new item will be initially checked
@return Itself | [
"Adds",
"an",
"item",
"to",
"the",
"checkbox",
"list",
"with",
"an",
"explicit",
"checked",
"status"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java#L99-L102 |
29,294 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java | CheckBoxList.setChecked | public synchronized CheckBoxList<V> setChecked(V object, boolean checked) {
int index = indexOf(object);
if(index != -1) {
setChecked(index, checked);
}
return self();
} | java | public synchronized CheckBoxList<V> setChecked(V object, boolean checked) {
int index = indexOf(object);
if(index != -1) {
setChecked(index, checked);
}
return self();
} | [
"public",
"synchronized",
"CheckBoxList",
"<",
"V",
">",
"setChecked",
"(",
"V",
"object",
",",
"boolean",
"checked",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"object",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"setChecked",
"(",
... | Programmatically sets the checked state of an item in the list box
@param object Object to set the checked state of
@param checked If {@code true}, then the item is set to checked, otherwise not
@return Itself | [
"Programmatically",
"sets",
"the",
"checked",
"state",
"of",
"an",
"item",
"in",
"the",
"list",
"box"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java#L138-L144 |
29,295 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java | CheckBoxList.getCheckedItems | public synchronized List<V> getCheckedItems() {
List<V> result = new ArrayList<V>();
for(int i = 0; i < itemStatus.size(); i++) {
if(itemStatus.get(i)) {
result.add(getItemAt(i));
}
}
return result;
} | java | public synchronized List<V> getCheckedItems() {
List<V> result = new ArrayList<V>();
for(int i = 0; i < itemStatus.size(); i++) {
if(itemStatus.get(i)) {
result.add(getItemAt(i));
}
}
return result;
} | [
"public",
"synchronized",
"List",
"<",
"V",
">",
"getCheckedItems",
"(",
")",
"{",
"List",
"<",
"V",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"V",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"itemStatus",
".",
"size",... | Returns all the items in the list box that have checked state, as a list
@return List of all items in the list box that has checked state on | [
"Returns",
"all",
"the",
"items",
"in",
"the",
"list",
"box",
"that",
"have",
"checked",
"state",
"as",
"a",
"list"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java#L162-L170 |
29,296 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/input/InputDecoder.java | InputDecoder.addProfile | public void addProfile(KeyDecodingProfile profile) {
for (CharacterPattern pattern : profile.getPatterns()) {
synchronized(bytePatterns) {
//If an equivalent pattern already exists, remove it first
bytePatterns.remove(pattern);
bytePatterns.add(pattern... | java | public void addProfile(KeyDecodingProfile profile) {
for (CharacterPattern pattern : profile.getPatterns()) {
synchronized(bytePatterns) {
//If an equivalent pattern already exists, remove it first
bytePatterns.remove(pattern);
bytePatterns.add(pattern... | [
"public",
"void",
"addProfile",
"(",
"KeyDecodingProfile",
"profile",
")",
"{",
"for",
"(",
"CharacterPattern",
"pattern",
":",
"profile",
".",
"getPatterns",
"(",
")",
")",
"{",
"synchronized",
"(",
"bytePatterns",
")",
"{",
"//If an equivalent pattern already exis... | Adds another key decoding profile to this InputDecoder, which means all patterns from the profile will be used
when decoding input.
@param profile Profile to add | [
"Adds",
"another",
"key",
"decoding",
"profile",
"to",
"this",
"InputDecoder",
"which",
"means",
"all",
"patterns",
"from",
"the",
"profile",
"will",
"be",
"used",
"when",
"decoding",
"input",
"."
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/input/InputDecoder.java#L57-L65 |
29,297 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/input/InputDecoder.java | InputDecoder.getNextCharacter | public synchronized KeyStroke getNextCharacter(boolean blockingIO) throws IOException {
KeyStroke bestMatch = null;
int bestLen = 0;
int curLen = 0;
while(true) {
if ( curLen < currentMatching.size() ) {
// (re-)consume characters previously read:
... | java | public synchronized KeyStroke getNextCharacter(boolean blockingIO) throws IOException {
KeyStroke bestMatch = null;
int bestLen = 0;
int curLen = 0;
while(true) {
if ( curLen < currentMatching.size() ) {
// (re-)consume characters previously read:
... | [
"public",
"synchronized",
"KeyStroke",
"getNextCharacter",
"(",
"boolean",
"blockingIO",
")",
"throws",
"IOException",
"{",
"KeyStroke",
"bestMatch",
"=",
"null",
";",
"int",
"bestLen",
"=",
"0",
";",
"int",
"curLen",
"=",
"0",
";",
"while",
"(",
"true",
")"... | Reads and decodes the next key stroke from the input stream
@param blockingIO If set to {@code true}, the call will not return until it has read at least one {@link KeyStroke}
@return Key stroke read from the input stream, or {@code null} if none
@throws IOException If there was an I/O error when reading from the input... | [
"Reads",
"and",
"decodes",
"the",
"next",
"key",
"stroke",
"from",
"the",
"input",
"stream"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/input/InputDecoder.java#L115-L214 |
29,298 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/MessageDialog.java | MessageDialog.showMessageDialog | public static MessageDialogButton showMessageDialog(
WindowBasedTextGUI textGUI,
String title,
String text,
MessageDialogButton... buttons) {
MessageDialogBuilder builder = new MessageDialogBuilder()
.setTitle(title)
.setText(text);... | java | public static MessageDialogButton showMessageDialog(
WindowBasedTextGUI textGUI,
String title,
String text,
MessageDialogButton... buttons) {
MessageDialogBuilder builder = new MessageDialogBuilder()
.setTitle(title)
.setText(text);... | [
"public",
"static",
"MessageDialogButton",
"showMessageDialog",
"(",
"WindowBasedTextGUI",
"textGUI",
",",
"String",
"title",
",",
"String",
"text",
",",
"MessageDialogButton",
"...",
"buttons",
")",
"{",
"MessageDialogBuilder",
"builder",
"=",
"new",
"MessageDialogBuil... | Shortcut for quickly displaying a message box
@param textGUI The GUI to display the message box on
@param title Title of the message box
@param text Main message of the message box
@param buttons Buttons that the user can confirm the message box with
@return Which button the user selected | [
"Shortcut",
"for",
"quickly",
"displaying",
"a",
"message",
"box"
] | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/MessageDialog.java#L93-L108 |
29,299 | mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/Panel.java | Panel.addComponent | public Panel addComponent(int index, Component component) {
if(component == null) {
throw new IllegalArgumentException("Cannot add null component");
}
synchronized(components) {
if(components.contains(component)) {
return this;
}
if... | java | public Panel addComponent(int index, Component component) {
if(component == null) {
throw new IllegalArgumentException("Cannot add null component");
}
synchronized(components) {
if(components.contains(component)) {
return this;
}
if... | [
"public",
"Panel",
"addComponent",
"(",
"int",
"index",
",",
"Component",
"component",
")",
"{",
"if",
"(",
"component",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot add null component\"",
")",
";",
"}",
"synchronized",
"(",... | Adds a new child component to the panel. Where within the panel the child will be displayed is up to the layout
manager assigned to this panel. If the component has already been added to another panel, it will first be
removed from that panel before added to this one.
@param component Child component to add to this pan... | [
"Adds",
"a",
"new",
"child",
"component",
"to",
"the",
"panel",
".",
"Where",
"within",
"the",
"panel",
"the",
"child",
"will",
"be",
"displayed",
"is",
"up",
"to",
"the",
"layout",
"manager",
"assigned",
"to",
"this",
"panel",
".",
"If",
"the",
"compone... | 8dfd62206ff46ab10223b2ef2dbb0a2c51850954 | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/Panel.java#L80-L102 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.