repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.dateTime | public Date dateTime(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
String dateString;
// From https://tools.ietf.org/html/rfc3501 :
// date-time = DQUOTE date-day-fixed "-" date-month "-" date-year
// SP time... | java | public Date dateTime(ImapRequestLineReader request) throws ProtocolException {
char next = request.nextWordChar();
String dateString;
// From https://tools.ietf.org/html/rfc3501 :
// date-time = DQUOTE date-day-fixed "-" date-month "-" date-year
// SP time... | [
"public",
"Date",
"dateTime",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"char",
"next",
"=",
"request",
".",
"nextWordChar",
"(",
")",
";",
"String",
"dateString",
";",
"// From https://tools.ietf.org/html/rfc3501 :",
"// date-tim... | Reads a "date-time" argument from the request. | [
"Reads",
"a",
"date",
"-",
"time",
"argument",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L109-L128 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.consumeWord | protected String consumeWord(ImapRequestLineReader request,
CharacterValidator validator)
throws ProtocolException {
StringBuilder atom = new StringBuilder();
char next = request.nextWordChar();
while (!isWhitespace(next)) {
if (validator... | java | protected String consumeWord(ImapRequestLineReader request,
CharacterValidator validator)
throws ProtocolException {
StringBuilder atom = new StringBuilder();
char next = request.nextWordChar();
while (!isWhitespace(next)) {
if (validator... | [
"protected",
"String",
"consumeWord",
"(",
"ImapRequestLineReader",
"request",
",",
"CharacterValidator",
"validator",
")",
"throws",
"ProtocolException",
"{",
"StringBuilder",
"atom",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
"next",
"=",
"request",
".",
... | Reads the next "word from the request, comprising all characters up to the next SPACE.
Characters are tested by the supplied CharacterValidator, and an exception is thrown
if invalid characters are encountered. | [
"Reads",
"the",
"next",
"word",
"from",
"the",
"request",
"comprising",
"all",
"characters",
"up",
"to",
"the",
"next",
"SPACE",
".",
"Characters",
"are",
"tested",
"by",
"the",
"supplied",
"CharacterValidator",
"and",
"an",
"exception",
"is",
"thrown",
"if",
... | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L135-L151 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.consumeChar | protected void consumeChar(ImapRequestLineReader request, char expected)
throws ProtocolException {
char consumed = request.consume();
if (consumed != expected) {
throw new ProtocolException("Expected:'" + expected + "' found:'" + consumed + '\'');
}
} | java | protected void consumeChar(ImapRequestLineReader request, char expected)
throws ProtocolException {
char consumed = request.consume();
if (consumed != expected) {
throw new ProtocolException("Expected:'" + expected + "' found:'" + consumed + '\'');
}
} | [
"protected",
"void",
"consumeChar",
"(",
"ImapRequestLineReader",
"request",
",",
"char",
"expected",
")",
"throws",
"ProtocolException",
"{",
"char",
"consumed",
"=",
"request",
".",
"consume",
"(",
")",
";",
"if",
"(",
"consumed",
"!=",
"expected",
")",
"{",... | Consumes the next character in the request, checking that it matches the
expected one. This method should be used when the | [
"Consumes",
"the",
"next",
"character",
"in",
"the",
"request",
"checking",
"that",
"it",
"matches",
"the",
"expected",
"one",
".",
"This",
"method",
"should",
"be",
"used",
"when",
"the"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L237-L243 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.consumeQuoted | protected String consumeQuoted(ImapRequestLineReader request)
throws ProtocolException {
// The 1st character must be '"'
consumeChar(request, '"');
StringBuilder quoted = new StringBuilder();
char next = request.nextChar();
while (next != '"') {
if (next... | java | protected String consumeQuoted(ImapRequestLineReader request)
throws ProtocolException {
// The 1st character must be '"'
consumeChar(request, '"');
StringBuilder quoted = new StringBuilder();
char next = request.nextChar();
while (next != '"') {
if (next... | [
"protected",
"String",
"consumeQuoted",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"// The 1st character must be '\"'",
"consumeChar",
"(",
"request",
",",
"'",
"'",
")",
";",
"StringBuilder",
"quoted",
"=",
"new",
"StringBuilder",... | Reads a quoted string value from the request. | [
"Reads",
"a",
"quoted",
"string",
"value",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L248-L272 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.flagList | public Flags flagList(ImapRequestLineReader request) throws ProtocolException {
Flags flags = new Flags();
request.nextWordChar();
consumeChar(request, '(');
CharacterValidator validator = new NoopCharValidator();
String nextWord = consumeWord(request, validator);
while (... | java | public Flags flagList(ImapRequestLineReader request) throws ProtocolException {
Flags flags = new Flags();
request.nextWordChar();
consumeChar(request, '(');
CharacterValidator validator = new NoopCharValidator();
String nextWord = consumeWord(request, validator);
while (... | [
"public",
"Flags",
"flagList",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"Flags",
"flags",
"=",
"new",
"Flags",
"(",
")",
";",
"request",
".",
"nextWordChar",
"(",
")",
";",
"consumeChar",
"(",
"request",
",",
"'",
"'"... | Reads a "flags" argument from the request. | [
"Reads",
"a",
"flags",
"argument",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L277-L293 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.number | public long number(ImapRequestLineReader request) throws ProtocolException {
String digits = consumeWord(request, new DigitCharValidator());
return Long.parseLong(digits);
} | java | public long number(ImapRequestLineReader request) throws ProtocolException {
String digits = consumeWord(request, new DigitCharValidator());
return Long.parseLong(digits);
} | [
"public",
"long",
"number",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"String",
"digits",
"=",
"consumeWord",
"(",
"request",
",",
"new",
"DigitCharValidator",
"(",
")",
")",
";",
"return",
"Long",
".",
"parseLong",
"(",
... | Reads an argument of type "number" from the request. | [
"Reads",
"an",
"argument",
"of",
"type",
"number",
"from",
"the",
"request",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L317-L320 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java | CommandParser.parseIdRange | public IdRange[] parseIdRange(ImapRequestLineReader request)
throws ProtocolException {
CharacterValidator validator = new MessageSetCharValidator();
String nextWord = consumeWord(request, validator);
int commaPos = nextWord.indexOf(',');
if (commaPos == -1) {
re... | java | public IdRange[] parseIdRange(ImapRequestLineReader request)
throws ProtocolException {
CharacterValidator validator = new MessageSetCharValidator();
String nextWord = consumeWord(request, validator);
int commaPos = nextWord.indexOf(',');
if (commaPos == -1) {
re... | [
"public",
"IdRange",
"[",
"]",
"parseIdRange",
"(",
"ImapRequestLineReader",
"request",
")",
"throws",
"ProtocolException",
"{",
"CharacterValidator",
"validator",
"=",
"new",
"MessageSetCharValidator",
"(",
")",
";",
"String",
"nextWord",
"=",
"consumeWord",
"(",
"... | Reads a "message set" argument, and parses into an IdSet.
Currently only supports a single range of values. | [
"Reads",
"a",
"message",
"set",
"argument",
"and",
"parses",
"into",
"an",
"IdSet",
".",
"Currently",
"only",
"supports",
"a",
"single",
"range",
"of",
"values",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/CommandParser.java#L372-L395 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/PropertiesBasedServerSetupBuilder.java | PropertiesBasedServerSetupBuilder.build | public ServerSetup[] build(Properties properties) {
List<ServerSetup> serverSetups = new ArrayList<>();
String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress());
long serverStartupTimeout =
Long.parseLong(properties.getProperty("greenmail... | java | public ServerSetup[] build(Properties properties) {
List<ServerSetup> serverSetups = new ArrayList<>();
String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress());
long serverStartupTimeout =
Long.parseLong(properties.getProperty("greenmail... | [
"public",
"ServerSetup",
"[",
"]",
"build",
"(",
"Properties",
"properties",
")",
"{",
"List",
"<",
"ServerSetup",
">",
"serverSetups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"hostname",
"=",
"properties",
".",
"getProperty",
"(",
"\"greenma... | Creates a server setup based on provided properties.
@param properties the properties.
@return the server setup, or an empty array. | [
"Creates",
"a",
"server",
"setup",
"based",
"on",
"provided",
"properties",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/PropertiesBasedServerSetupBuilder.java#L58-L86 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/store/MessageFlags.java | MessageFlags.format | public static String format(Flags flags) {
StringBuilder buf = new StringBuilder();
buf.append('(');
if (flags.contains(Flags.Flag.ANSWERED)) {
buf.append("\\Answered ");
}
if (flags.contains(Flags.Flag.DELETED)) {
buf.append("\\Deleted ");
... | java | public static String format(Flags flags) {
StringBuilder buf = new StringBuilder();
buf.append('(');
if (flags.contains(Flags.Flag.ANSWERED)) {
buf.append("\\Answered ");
}
if (flags.contains(Flags.Flag.DELETED)) {
buf.append("\\Deleted ");
... | [
"public",
"static",
"String",
"format",
"(",
"Flags",
"flags",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",
".",
"append",
"(",
"'",
"'",
")",
";",
"if",
"(",
"flags",
".",
"contains",
"(",
"Flags",
".",
"Flag"... | Returns IMAP formatted String of MessageFlags for named user | [
"Returns",
"IMAP",
"formatted",
"String",
"of",
"MessageFlags",
"for",
"named",
"user"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/store/MessageFlags.java#L47-L80 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.eol | public void eol() throws ProtocolException {
char next = nextChar();
// Ignore trailing spaces.
while (next == ' ') {
consume();
next = nextChar();
}
// handle DOS and unix end-of-lines
if (next == '\r') {
consume();
... | java | public void eol() throws ProtocolException {
char next = nextChar();
// Ignore trailing spaces.
while (next == ' ') {
consume();
next = nextChar();
}
// handle DOS and unix end-of-lines
if (next == '\r') {
consume();
... | [
"public",
"void",
"eol",
"(",
")",
"throws",
"ProtocolException",
"{",
"char",
"next",
"=",
"nextChar",
"(",
")",
";",
"// Ignore trailing spaces.\r",
"while",
"(",
"next",
"==",
"'",
"'",
")",
"{",
"consume",
"(",
")",
";",
"next",
"=",
"nextChar",
"(",... | Moves the request line reader to end of the line, checking that no non-space
character are found.
@throws ProtocolException If more non-space tokens are found in this line,
or the end-of-file is reached. | [
"Moves",
"the",
"request",
"line",
"reader",
"to",
"end",
"of",
"the",
"line",
"checking",
"that",
"no",
"non",
"-",
"space",
"character",
"are",
"found",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L104-L124 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.read | public void read(byte[] holder) throws ProtocolException {
int readTotal = 0;
try {
while (readTotal < holder.length) {
int count = input.read(holder, readTotal, holder.length - readTotal);
if (count == -1) {
throw new ProtocolExcepti... | java | public void read(byte[] holder) throws ProtocolException {
int readTotal = 0;
try {
while (readTotal < holder.length) {
int count = input.read(holder, readTotal, holder.length - readTotal);
if (count == -1) {
throw new ProtocolExcepti... | [
"public",
"void",
"read",
"(",
"byte",
"[",
"]",
"holder",
")",
"throws",
"ProtocolException",
"{",
"int",
"readTotal",
"=",
"0",
";",
"try",
"{",
"while",
"(",
"readTotal",
"<",
"holder",
".",
"length",
")",
"{",
"int",
"count",
"=",
"input",
".",
"... | Reads and consumes a number of characters from the underlying reader,
filling the byte array provided.
@param holder A byte array which will be filled with bytes read from the underlying reader.
@throws ProtocolException If a char can't be read into each array element. | [
"Reads",
"and",
"consumes",
"a",
"number",
"of",
"characters",
"from",
"the",
"underlying",
"reader",
"filling",
"the",
"byte",
"array",
"provided",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L150-L166 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java | ImapRequestLineReader.commandContinuationRequest | public void commandContinuationRequest()
throws ProtocolException {
try {
output.write('+');
output.write(' ');
output.write('O');
output.write('K');
output.write('\r');
output.write('\n');
output.flush();
... | java | public void commandContinuationRequest()
throws ProtocolException {
try {
output.write('+');
output.write(' ');
output.write('O');
output.write('K');
output.write('\r');
output.write('\n');
output.flush();
... | [
"public",
"void",
"commandContinuationRequest",
"(",
")",
"throws",
"ProtocolException",
"{",
"try",
"{",
"output",
".",
"write",
"(",
"'",
"'",
")",
";",
"output",
".",
"write",
"(",
"'",
"'",
")",
";",
"output",
".",
"write",
"(",
"'",
"'",
")",
";... | Sends a server command continuation request '+' back to the client,
requesting more data to be sent. | [
"Sends",
"a",
"server",
"command",
"continuation",
"request",
"+",
"back",
"to",
"the",
"client",
"requesting",
"more",
"data",
"to",
"be",
"sent",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L172-L185 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/UserUtil.java | UserUtil.createUsers | public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
for (InternetAddress address : addresses) {
greenMail.setUser(address.getAddress(), address.getAddress());
}
} | java | public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
for (InternetAddress address : addresses) {
greenMail.setUser(address.getAddress(), address.getAddress());
}
} | [
"public",
"static",
"void",
"createUsers",
"(",
"GreenMailOperations",
"greenMail",
",",
"InternetAddress",
"...",
"addresses",
")",
"{",
"for",
"(",
"InternetAddress",
"address",
":",
"addresses",
")",
"{",
"greenMail",
".",
"setUser",
"(",
"address",
".",
"get... | Create users for the given array of addresses. The passwords will be set to the email addresses.
@param greenMail Greenmail instance to create users for
@param addresses Addresses | [
"Create",
"users",
"for",
"the",
"given",
"array",
"of",
"addresses",
".",
"The",
"passwords",
"will",
"be",
"set",
"to",
"the",
"email",
"addresses",
"."
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/UserUtil.java#L23-L27 | train |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java | IdRange.containsUid | public static boolean containsUid(IdRange[] idRanges, long uid) {
if (null != idRanges && idRanges.length > 0) {
for (IdRange range : idRanges) {
if (range.includes(uid)) {
return true;
}
}
}
return false;
} | java | public static boolean containsUid(IdRange[] idRanges, long uid) {
if (null != idRanges && idRanges.length > 0) {
for (IdRange range : idRanges) {
if (range.includes(uid)) {
return true;
}
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsUid",
"(",
"IdRange",
"[",
"]",
"idRanges",
",",
"long",
"uid",
")",
"{",
"if",
"(",
"null",
"!=",
"idRanges",
"&&",
"idRanges",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"IdRange",
"range",
":",
"idRanges",... | Checks if ranges contain the uid
@param idRanges the id ranges
@param uid the uid
@return true, if ranges contain given uid | [
"Checks",
"if",
"ranges",
"contain",
"the",
"uid"
] | 6d19a62233d1ef6fedbbd1f6fdde2d28e713834a | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java#L149-L158 | train |
osiegmar/logback-gelf | src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java | SimpleJsonEncoder.appendToJSON | SimpleJsonEncoder appendToJSON(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
if (value instanceof Number) {
sb.append(value.toString());
... | java | SimpleJsonEncoder appendToJSON(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
if (value instanceof Number) {
sb.append(value.toString());
... | [
"SimpleJsonEncoder",
"appendToJSON",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"closed",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Encoder already closed\"",
")",
";",
"}",
"if",
"(",
"value",
"!=",
... | Append field with quotes and escape characters added, if required.
@return this | [
"Append",
"field",
"with",
"quotes",
"and",
"escape",
"characters",
"added",
"if",
"required",
"."
] | 35c41eda363db803c8c4570f31d518451e9a879b | https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java#L53-L66 | train |
osiegmar/logback-gelf | src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java | SimpleJsonEncoder.appendToJSONUnquoted | SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
sb.append(value);
}
return this;
} | java | SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) {
if (closed) {
throw new IllegalStateException("Encoder already closed");
}
if (value != null) {
appendKey(key);
sb.append(value);
}
return this;
} | [
"SimpleJsonEncoder",
"appendToJSONUnquoted",
"(",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"closed",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Encoder already closed\"",
")",
";",
"}",
"if",
"(",
"value",
... | Append field with quotes and escape characters added in the key, if required.
The value is added without quotes and any escape characters.
@return this | [
"Append",
"field",
"with",
"quotes",
"and",
"escape",
"characters",
"added",
"in",
"the",
"key",
"if",
"required",
".",
"The",
"value",
"is",
"added",
"without",
"quotes",
"and",
"any",
"escape",
"characters",
"."
] | 35c41eda363db803c8c4570f31d518451e9a879b | https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java#L74-L83 | train |
osiegmar/logback-gelf | src/main/java/de/siegmar/logbackgelf/GelfTcpAppender.java | GelfTcpAppender.sendMessage | @SuppressWarnings("checkstyle:illegalcatch")
private boolean sendMessage(final byte[] messageToSend) {
try {
connectionPool.execute(new PooledObjectConsumer<TcpConnection>() {
@Override
public void accept(final TcpConnection tcpConnection) throws IOException {
... | java | @SuppressWarnings("checkstyle:illegalcatch")
private boolean sendMessage(final byte[] messageToSend) {
try {
connectionPool.execute(new PooledObjectConsumer<TcpConnection>() {
@Override
public void accept(final TcpConnection tcpConnection) throws IOException {
... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:illegalcatch\"",
")",
"private",
"boolean",
"sendMessage",
"(",
"final",
"byte",
"[",
"]",
"messageToSend",
")",
"{",
"try",
"{",
"connectionPool",
".",
"execute",
"(",
"new",
"PooledObjectConsumer",
"<",
"TcpConnection",
... | Send message to socket's output stream.
@param messageToSend message to send.
@return {@code true} if message was sent successfully, {@code false} otherwise. | [
"Send",
"message",
"to",
"socket",
"s",
"output",
"stream",
"."
] | 35c41eda363db803c8c4570f31d518451e9a879b | https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/GelfTcpAppender.java#L170-L187 | train |
brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/internal/BaseEventProcessor.java | BaseEventProcessor.run | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > lingerIterations && pidToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
}
}
catch... | java | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > lingerIterations && pidToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
}
}
catch... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"startBarrier",
".",
"await",
"(",
")",
";",
"int",
"idleCount",
"=",
"0",
";",
"while",
"(",
"!",
"isRunning",
".",
"compareAndSet",
"(",
"idleCount",
">",
"lingerIterations",
"&&",
... | The primary run loop of the event processor. | [
"The",
"primary",
"run",
"loop",
"of",
"the",
"event",
"processor",
"."
] | d4abdd195367fce7375a0b45cb2f5eeff1c74d03 | https://github.com/brettwooldridge/NuProcess/blob/d4abdd195367fce7375a0b45cb2f5eeff1c74d03/src/main/java/com/zaxxer/nuprocess/internal/BaseEventProcessor.java#L70-L85 | train |
brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/internal/HexDumpElf.java | HexDumpElf.dump | public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)
{
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb);
StringBuilder ascii = new StringBuilder();
int dataNdx = offset;
final int maxDataNdx = offset + len... | java | public static String dump(final int displayOffset, final byte[] data, final int offset, final int len)
{
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb);
StringBuilder ascii = new StringBuilder();
int dataNdx = offset;
final int maxDataNdx = offset + len... | [
"public",
"static",
"String",
"dump",
"(",
"final",
"int",
"displayOffset",
",",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
... | Dump an array of bytes in hexadecimal.
@param displayOffset the display offset (left column)
@param data the byte array of data
@param offset the offset to start dumping in the byte array
@param len the length of data to dump
@return the dump string | [
"Dump",
"an",
"array",
"of",
"bytes",
"in",
"hexadecimal",
"."
] | d4abdd195367fce7375a0b45cb2f5eeff1c74d03 | https://github.com/brettwooldridge/NuProcess/blob/d4abdd195367fce7375a0b45cb2f5eeff1c74d03/src/main/java/com/zaxxer/nuprocess/internal/HexDumpElf.java#L44-L79 | train |
brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java | ProcessCompletions.run | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > LINGER_ITERATIONS && deadPool.isEmpty() && completionKeyToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1... | java | @Override
public void run()
{
try {
startBarrier.await();
int idleCount = 0;
while (!isRunning.compareAndSet(idleCount > LINGER_ITERATIONS && deadPool.isEmpty() && completionKeyToProcessMap.isEmpty(), false)) {
idleCount = (!shutdown && process()) ? 0 : (idleCount + 1... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"startBarrier",
".",
"await",
"(",
")",
";",
"int",
"idleCount",
"=",
"0",
";",
"while",
"(",
"!",
"isRunning",
".",
"compareAndSet",
"(",
"idleCount",
">",
"LINGER_ITERATIONS",
"&&",
... | The primary run loop of the kqueue event processor. | [
"The",
"primary",
"run",
"loop",
"of",
"the",
"kqueue",
"event",
"processor",
"."
] | d4abdd195367fce7375a0b45cb2f5eeff1c74d03 | https://github.com/brettwooldridge/NuProcess/blob/d4abdd195367fce7375a0b45cb2f5eeff1c74d03/src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java#L88-L104 | train |
nispok/snackbar | lib/src/main/java/com/nispok/snackbar/Snackbar.java | Snackbar.actionLabel | public Snackbar actionLabel(CharSequence actionButtonLabel) {
mActionLabel = actionButtonLabel;
if (snackbarAction != null) {
snackbarAction.setText(mActionLabel);
}
return this;
} | java | public Snackbar actionLabel(CharSequence actionButtonLabel) {
mActionLabel = actionButtonLabel;
if (snackbarAction != null) {
snackbarAction.setText(mActionLabel);
}
return this;
} | [
"public",
"Snackbar",
"actionLabel",
"(",
"CharSequence",
"actionButtonLabel",
")",
"{",
"mActionLabel",
"=",
"actionButtonLabel",
";",
"if",
"(",
"snackbarAction",
"!=",
"null",
")",
"{",
"snackbarAction",
".",
"setText",
"(",
"mActionLabel",
")",
";",
"}",
"re... | Sets the action label to be displayed, if any. Note that if this is not set, the action
button will not be displayed
@param actionButtonLabel
@return | [
"Sets",
"the",
"action",
"label",
"to",
"be",
"displayed",
"if",
"any",
".",
"Note",
"that",
"if",
"this",
"is",
"not",
"set",
"the",
"action",
"button",
"will",
"not",
"be",
"displayed"
] | a4e0449874423031107f6aaa7e97d0f1714a1d3b | https://github.com/nispok/snackbar/blob/a4e0449874423031107f6aaa7e97d0f1714a1d3b/lib/src/main/java/com/nispok/snackbar/Snackbar.java#L264-L270 | train |
nispok/snackbar | lib/src/main/java/com/nispok/snackbar/Snackbar.java | Snackbar.setBackgroundDrawable | public static void setBackgroundDrawable(View view, Drawable drawable) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
} else {
view.setBackground(drawable);
}
} | java | public static void setBackgroundDrawable(View view, Drawable drawable) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
} else {
view.setBackground(drawable);
}
} | [
"public",
"static",
"void",
"setBackgroundDrawable",
"(",
"View",
"view",
",",
"Drawable",
"drawable",
")",
"{",
"if",
"(",
"android",
".",
"os",
".",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"android",
".",
"os",
".",
"Build",
".",
"VERSION_CODES",
... | Set a Background Drawable using the appropriate Android version api call
@param view
@param drawable | [
"Set",
"a",
"Background",
"Drawable",
"using",
"the",
"appropriate",
"Android",
"version",
"api",
"call"
] | a4e0449874423031107f6aaa7e97d0f1714a1d3b | https://github.com/nispok/snackbar/blob/a4e0449874423031107f6aaa7e97d0f1714a1d3b/lib/src/main/java/com/nispok/snackbar/Snackbar.java#L1222-L1228 | train |
redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitRequire | public void visitRequire(String module, int access, String version) {
if (mv != null) {
mv.visitRequire(module, access, version);
}
} | java | public void visitRequire(String module, int access, String version) {
if (mv != null) {
mv.visitRequire(module, access, version);
}
} | [
"public",
"void",
"visitRequire",
"(",
"String",
"module",
",",
"int",
"access",
",",
"String",
"version",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitRequire",
"(",
"module",
",",
"access",
",",
"version",
")",
";",
"}",
"}"
... | Visits a dependence of the current module.
@param module the qualified name of the dependence.
@param access the access flag of the dependence among
ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC
and ACC_MANDATED.
@param version the module version at compile time or null. | [
"Visits",
"a",
"dependence",
"of",
"the",
"current",
"module",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L145-L149 | train |
redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitExport | public void visitExport(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitExport(packaze, access, modules);
}
} | java | public void visitExport(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitExport(packaze, access, modules);
}
} | [
"public",
"void",
"visitExport",
"(",
"String",
"packaze",
",",
"int",
"access",
",",
"String",
"...",
"modules",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitExport",
"(",
"packaze",
",",
"access",
",",
"modules",
")",
";",
"}... | Visit an exported package of the current module.
@param packaze the qualified name of the exported package.
@param access the access flag of the exported package,
valid values are among {@code ACC_SYNTHETIC} and
{@code ACC_MANDATED}.
@param modules the qualified names of the modules that can access to
the public class... | [
"Visit",
"an",
"exported",
"package",
"of",
"the",
"current",
"module",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L162-L166 | train |
redkale/redkale | src/org/redkale/asm/ModuleVisitor.java | ModuleVisitor.visitOpen | public void visitOpen(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitOpen(packaze, access, modules);
}
} | java | public void visitOpen(String packaze, int access, String... modules) {
if (mv != null) {
mv.visitOpen(packaze, access, modules);
}
} | [
"public",
"void",
"visitOpen",
"(",
"String",
"packaze",
",",
"int",
"access",
",",
"String",
"...",
"modules",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitOpen",
"(",
"packaze",
",",
"access",
",",
"modules",
")",
";",
"}",
... | Visit an open package of the current module.
@param packaze the qualified name of the opened package.
@param access the access flag of the opened package,
valid values are among {@code ACC_SYNTHETIC} and
{@code ACC_MANDATED}.
@param modules the qualified names of the modules that can use deep
reflection to the classes... | [
"Visit",
"an",
"open",
"package",
"of",
"the",
"current",
"module",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ModuleVisitor.java#L179-L183 | train |
redkale/redkale | src/org/redkale/asm/ClassReader.java | ClassReader.readTypeAnnotations | private int[] readTypeAnnotations(final MethodVisitor mv,
final Context context, int u, boolean visible) {
char[] c = context.buffer;
int[] offsets = new int[readUnsignedShort(u)];
u += 2;
for (int i = 0; i < offsets.length; ++i) {
offsets[i] = u;
int ... | java | private int[] readTypeAnnotations(final MethodVisitor mv,
final Context context, int u, boolean visible) {
char[] c = context.buffer;
int[] offsets = new int[readUnsignedShort(u)];
u += 2;
for (int i = 0; i < offsets.length; ++i) {
offsets[i] = u;
int ... | [
"private",
"int",
"[",
"]",
"readTypeAnnotations",
"(",
"final",
"MethodVisitor",
"mv",
",",
"final",
"Context",
"context",
",",
"int",
"u",
",",
"boolean",
"visible",
")",
"{",
"char",
"[",
"]",
"c",
"=",
"context",
".",
"buffer",
";",
"int",
"[",
"]"... | Parses a type annotation table to find the labels, and to visit the try
catch block annotations.
@param u
the start offset of a type annotation table.
@param mv
the method visitor to be used to visit the try catch block
annotations.
@param context
information about the class being parsed.
@param visible
if the type an... | [
"Parses",
"a",
"type",
"annotation",
"table",
"to",
"find",
"the",
"labels",
"and",
"to",
"visit",
"the",
"try",
"catch",
"block",
"annotations",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassReader.java#L1786-L1848 | train |
redkale/redkale | src/org/redkale/asm/MethodWriter.java | MethodWriter.visitImplicitFirstFrame | private void visitImplicitFirstFrame() {
// There can be at most descriptor.length() + 1 locals
int frameIndex = startFrame(0, descriptor.length() + 1, 0);
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & ACC_CONSTRUCTOR) == 0) {
frame[frameIndex++] = Frame.OBJ... | java | private void visitImplicitFirstFrame() {
// There can be at most descriptor.length() + 1 locals
int frameIndex = startFrame(0, descriptor.length() + 1, 0);
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & ACC_CONSTRUCTOR) == 0) {
frame[frameIndex++] = Frame.OBJ... | [
"private",
"void",
"visitImplicitFirstFrame",
"(",
")",
"{",
"// There can be at most descriptor.length() + 1 locals",
"int",
"frameIndex",
"=",
"startFrame",
"(",
"0",
",",
"descriptor",
".",
"length",
"(",
")",
"+",
"1",
",",
"0",
")",
";",
"if",
"(",
"(",
"... | Visit the implicit first frame of this method. | [
"Visit",
"the",
"implicit",
"first",
"frame",
"of",
"this",
"method",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodWriter.java#L1809-L1864 | train |
redkale/redkale | src/org/redkale/asm/ClassWriter.java | ClassWriter.newStringishItem | Item newStringishItem(final int type, final String value) {
key2.set(type, value, null, null);
Item result = get(key2);
if (result == null) {
pool.put12(type, newUTF8(value));
result = new Item(index++, key2);
put(result);
}
return result;
... | java | Item newStringishItem(final int type, final String value) {
key2.set(type, value, null, null);
Item result = get(key2);
if (result == null) {
pool.put12(type, newUTF8(value));
result = new Item(index++, key2);
put(result);
}
return result;
... | [
"Item",
"newStringishItem",
"(",
"final",
"int",
"type",
",",
"final",
"String",
"value",
")",
"{",
"key2",
".",
"set",
"(",
"type",
",",
"value",
",",
"null",
",",
"null",
")",
";",
"Item",
"result",
"=",
"get",
"(",
"key2",
")",
";",
"if",
"(",
... | Adds a string reference, a class reference, a method type, a module
or a package to the constant pool of the class being build.
Does nothing if the constant pool already contains a similar item.
@param type
a type among STR, CLASS, MTYPE, MODULE or PACKAGE
@param value
string value of the reference.
@return a new or a... | [
"Adds",
"a",
"string",
"reference",
"a",
"class",
"reference",
"a",
"method",
"type",
"a",
"module",
"or",
"a",
"package",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"... | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/ClassWriter.java#L1188-L1197 | train |
redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitParameter | public void visitParameter(String name, int access) {
if (mv != null) {
mv.visitParameter(name, access);
}
} | java | public void visitParameter(String name, int access) {
if (mv != null) {
mv.visitParameter(name, access);
}
} | [
"public",
"void",
"visitParameter",
"(",
"String",
"name",
",",
"int",
"access",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitParameter",
"(",
"name",
",",
"access",
")",
";",
"}",
"}"
] | Visits a parameter of this method.
@param name
parameter name or null if none is provided.
@param access
the parameter's access flags, only <tt>ACC_FINAL</tt>,
<tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
allowed (see {@link Opcodes}). | [
"Visits",
"a",
"parameter",
"of",
"this",
"method",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L139-L143 | train |
redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitMethodInsn | public void visitMethodInsn(int opcode, String owner, String name,
String desc, boolean itf) {
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
} | java | public void visitMethodInsn(int opcode, String owner, String name,
String desc, boolean itf) {
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
} | [
"public",
"void",
"visitMethodInsn",
"(",
"int",
"opcode",
",",
"String",
"owner",
",",
"String",
"name",
",",
"String",
"desc",
",",
"boolean",
"itf",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitMethodInsn",
"(",
"opcode",
",",... | Visits a method instruction. A method instruction is an instruction that
invokes a method.
@param opcode
the opcode of the type instruction to be visited. This opcode
is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
INVOKEINTERFACE.
@param owner
the internal name of the method's owner class (see
{@link Type#get... | [
"Visits",
"a",
"method",
"instruction",
".",
"A",
"method",
"instruction",
"is",
"an",
"instruction",
"that",
"invokes",
"a",
"method",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L466-L471 | train |
redkale/redkale | src/org/redkale/asm/MethodVisitor.java | MethodVisitor.visitLocalVariableAnnotation | public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
if (mv != null) {
return mv.visitLocalVariableAnnotation(typeRef, typePath, start,
end, index, de... | java | public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
TypePath typePath, Label[] start, Label[] end, int[] index,
String desc, boolean visible) {
if (mv != null) {
return mv.visitLocalVariableAnnotation(typeRef, typePath, start,
end, index, de... | [
"public",
"AnnotationVisitor",
"visitLocalVariableAnnotation",
"(",
"int",
"typeRef",
",",
"TypePath",
"typePath",
",",
"Label",
"[",
"]",
"start",
",",
"Label",
"[",
"]",
"end",
",",
"int",
"[",
"]",
"index",
",",
"String",
"desc",
",",
"boolean",
"visible"... | Visits an annotation on a local variable type.
@param typeRef
a reference to the annotated type. The sort of this type
reference must be {@link TypeReference#LOCAL_VARIABLE
LOCAL_VARIABLE} or {@link TypeReference#RESOURCE_VARIABLE
RESOURCE_VARIABLE}. See {@link TypeReference}.
@param typePath
the path to the annotated... | [
"Visits",
"an",
"annotation",
"on",
"a",
"local",
"variable",
"type",
"."
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/asm/MethodVisitor.java#L803-L811 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollection.java | MaterialCollection.setHeader | public void setHeader(String header) {
headerLabel.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(header));
addStyleName(CssName.WITH_HEADER);
ListItem item = new ListItem(headerLabel);
UiHelper.addMousePressedHandlers(item);
item.setStyleName(CssName.COLLECTION_HEADER);
... | java | public void setHeader(String header) {
headerLabel.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(header));
addStyleName(CssName.WITH_HEADER);
ListItem item = new ListItem(headerLabel);
UiHelper.addMousePressedHandlers(item);
item.setStyleName(CssName.COLLECTION_HEADER);
... | [
"public",
"void",
"setHeader",
"(",
"String",
"header",
")",
"{",
"headerLabel",
".",
"getElement",
"(",
")",
".",
"setInnerSafeHtml",
"(",
"SafeHtmlUtils",
".",
"fromString",
"(",
"header",
")",
")",
";",
"addStyleName",
"(",
"CssName",
".",
"WITH_HEADER",
... | Sets the header of the collection component. | [
"Sets",
"the",
"header",
"of",
"the",
"collection",
"component",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollection.java#L147-L154 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTooltip.java | MaterialTooltip.setHtml | public void setHtml(String html) {
this.html = html;
if (widget != null) {
if (widget.isAttached()) {
tooltipElement.find("span")
.html(html != null ? html : "");
} else {
widget.addAttachHandler(event ->
... | java | public void setHtml(String html) {
this.html = html;
if (widget != null) {
if (widget.isAttached()) {
tooltipElement.find("span")
.html(html != null ? html : "");
} else {
widget.addAttachHandler(event ->
... | [
"public",
"void",
"setHtml",
"(",
"String",
"html",
")",
"{",
"this",
".",
"html",
"=",
"html",
";",
"if",
"(",
"widget",
"!=",
"null",
")",
"{",
"if",
"(",
"widget",
".",
"isAttached",
"(",
")",
")",
"{",
"tooltipElement",
".",
"find",
"(",
"\"spa... | Set the html as value inside the tooltip. | [
"Set",
"the",
"html",
"as",
"value",
"inside",
"the",
"tooltip",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTooltip.java#L325-L340 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.addItem | public void addItem(T value, String text, boolean reload) {
values.add(value);
listBox.addItem(text, keyFactory.generateKey(value));
if (reload) {
reload();
}
} | java | public void addItem(T value, String text, boolean reload) {
values.add(value);
listBox.addItem(text, keyFactory.generateKey(value));
if (reload) {
reload();
}
} | [
"public",
"void",
"addItem",
"(",
"T",
"value",
",",
"String",
"text",
",",
"boolean",
"reload",
")",
"{",
"values",
".",
"add",
"(",
"value",
")",
";",
"listBox",
".",
"addItem",
"(",
"text",
",",
"keyFactory",
".",
"generateKey",
"(",
"value",
")",
... | Adds an item to the list box, specifying an initial value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param text the text of the item to be added
@param reload perform a 'material select' reload to update the DOM. | [
"Adds",
"an",
"item",
"to",
"the",
"list",
"box",
"specifying",
"an",
"initial",
"value",
"for",
"the",
"item",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L258-L265 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.addItem | public void addItem(T value, Direction dir, String text) {
addItem(value, dir, text, true);
} | java | public void addItem(T value, Direction dir, String text) {
addItem(value, dir, text, true);
} | [
"public",
"void",
"addItem",
"(",
"T",
"value",
",",
"Direction",
"dir",
",",
"String",
"text",
")",
"{",
"addItem",
"(",
"value",
",",
"dir",
",",
"text",
",",
"true",
")",
";",
"}"
] | Adds an item to the list box, specifying its direction and an initial
value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param dir the item's direction
@param text the text of the item to be added | [
"Adds",
"an",
"item",
"to",
"the",
"list",
"box",
"specifying",
"its",
"direction",
"and",
"an",
"initial",
"value",
"for",
"the",
"item",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L276-L278 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.removeValue | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | java | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | [
"public",
"void",
"removeValue",
"(",
"T",
"value",
",",
"boolean",
"reload",
")",
"{",
"int",
"idx",
"=",
"getIndex",
"(",
"value",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"removeItemInternal",
"(",
"idx",
",",
"reload",
")",
";",
"}",
"}... | Removes a value from the list box. Nothing is done if the value isn't on
the list box.
@param value the value to be removed from the list
@param reload perform a 'material select' reload to update the DOM. | [
"Removes",
"a",
"value",
"from",
"the",
"list",
"box",
".",
"Nothing",
"is",
"done",
"if",
"the",
"value",
"isn",
"t",
"on",
"the",
"list",
"box",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L507-L512 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.clear | @Override
public void clear() {
values.clear();
listBox.clear();
clearStatusText();
if (emptyPlaceHolder != null) {
insertEmptyPlaceHolder(emptyPlaceHolder);
}
reload();
if (isAllowBlank()) {
addBlankItemIfNeeded();
}
} | java | @Override
public void clear() {
values.clear();
listBox.clear();
clearStatusText();
if (emptyPlaceHolder != null) {
insertEmptyPlaceHolder(emptyPlaceHolder);
}
reload();
if (isAllowBlank()) {
addBlankItemIfNeeded();
}
} | [
"@",
"Override",
"public",
"void",
"clear",
"(",
")",
"{",
"values",
".",
"clear",
"(",
")",
";",
"listBox",
".",
"clear",
"(",
")",
";",
"clearStatusText",
"(",
")",
";",
"if",
"(",
"emptyPlaceHolder",
"!=",
"null",
")",
"{",
"insertEmptyPlaceHolder",
... | Removes all items from the list box. | [
"Removes",
"all",
"items",
"from",
"the",
"list",
"box",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L527-L540 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.getItemsSelected | public String[] getItemsSelected() {
List<String> selected = new LinkedList<>();
for (int i = getIndexOffset(); i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i));
}
}
return selected.toArray(new S... | java | public String[] getItemsSelected() {
List<String> selected = new LinkedList<>();
for (int i = getIndexOffset(); i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i));
}
}
return selected.toArray(new S... | [
"public",
"String",
"[",
"]",
"getItemsSelected",
"(",
")",
"{",
"List",
"<",
"String",
">",
"selected",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"getIndexOffset",
"(",
")",
";",
"i",
"<",
"listBox",
".",
"getItemCo... | Returns all selected values of the list box, or empty array if none.
@return the selected values of the list box | [
"Returns",
"all",
"selected",
"values",
"of",
"the",
"list",
"box",
"or",
"empty",
"array",
"if",
"none",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L977-L985 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.setValueSelected | public void setValueSelected(T value, boolean selected) {
int idx = getIndex(value);
if (idx >= 0) {
setItemSelectedInternal(idx, selected);
}
} | java | public void setValueSelected(T value, boolean selected) {
int idx = getIndex(value);
if (idx >= 0) {
setItemSelectedInternal(idx, selected);
}
} | [
"public",
"void",
"setValueSelected",
"(",
"T",
"value",
",",
"boolean",
"selected",
")",
"{",
"int",
"idx",
"=",
"getIndex",
"(",
"value",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"setItemSelectedInternal",
"(",
"idx",
",",
"selected",
")",
";... | Sets whether an individual list value is selected.
@param value the value of the item to be selected or unselected
@param selected <code>true</code> to select the item | [
"Sets",
"whether",
"an",
"individual",
"list",
"value",
"is",
"selected",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L1010-L1015 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.getIndex | public int getIndex(T value) {
int count = getItemCount();
for (int i = 0; i < count; i++) {
if (Objects.equals(getValue(i), value)) {
return i;
}
}
return -1;
} | java | public int getIndex(T value) {
int count = getItemCount();
for (int i = 0; i < count; i++) {
if (Objects.equals(getValue(i), value)) {
return i;
}
}
return -1;
} | [
"public",
"int",
"getIndex",
"(",
"T",
"value",
")",
"{",
"int",
"count",
"=",
"getItemCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Objects",
".",
"equals",
"(",
"getValu... | Gets the index of the specified value.
@param value the value of the item to be found
@return the index of the value | [
"Gets",
"the",
"index",
"of",
"the",
"specified",
"value",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L1023-L1031 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java | MaterialSearch.addSearchFinishHandler | @Override
public HandlerRegistration addSearchFinishHandler(final SearchFinishEvent.SearchFinishHandler handler) {
return addHandler(handler, SearchFinishEvent.TYPE);
} | java | @Override
public HandlerRegistration addSearchFinishHandler(final SearchFinishEvent.SearchFinishHandler handler) {
return addHandler(handler, SearchFinishEvent.TYPE);
} | [
"@",
"Override",
"public",
"HandlerRegistration",
"addSearchFinishHandler",
"(",
"final",
"SearchFinishEvent",
".",
"SearchFinishHandler",
"handler",
")",
"{",
"return",
"addHandler",
"(",
"handler",
",",
"SearchFinishEvent",
".",
"TYPE",
")",
";",
"}"
] | This handler will be triggered when search is finish | [
"This",
"handler",
"will",
"be",
"triggered",
"when",
"search",
"is",
"finish"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java#L371-L374 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java | MaterialSearch.addSearchNoResultHandler | @Override
public HandlerRegistration addSearchNoResultHandler(final SearchNoResultEvent.SearchNoResultHandler handler) {
return addHandler(handler, SearchNoResultEvent.TYPE);
} | java | @Override
public HandlerRegistration addSearchNoResultHandler(final SearchNoResultEvent.SearchNoResultHandler handler) {
return addHandler(handler, SearchNoResultEvent.TYPE);
} | [
"@",
"Override",
"public",
"HandlerRegistration",
"addSearchNoResultHandler",
"(",
"final",
"SearchNoResultEvent",
".",
"SearchNoResultHandler",
"handler",
")",
"{",
"return",
"addHandler",
"(",
"handler",
",",
"SearchNoResultEvent",
".",
"TYPE",
")",
";",
"}"
] | This handler will be triggered when there's no search result | [
"This",
"handler",
"will",
"be",
"triggered",
"when",
"there",
"s",
"no",
"search",
"result"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java#L379-L382 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java | AbstractButton.setSize | public void setSize(ButtonSize size) {
if (this.size != null) {
removeStyleName(this.size.getCssName());
}
this.size = size;
if (size != null) {
addStyleName(size.getCssName());
}
} | java | public void setSize(ButtonSize size) {
if (this.size != null) {
removeStyleName(this.size.getCssName());
}
this.size = size;
if (size != null) {
addStyleName(size.getCssName());
}
} | [
"public",
"void",
"setSize",
"(",
"ButtonSize",
"size",
")",
"{",
"if",
"(",
"this",
".",
"size",
"!=",
"null",
")",
"{",
"removeStyleName",
"(",
"this",
".",
"size",
".",
"getCssName",
"(",
")",
")",
";",
"}",
"this",
".",
"size",
"=",
"size",
";"... | Set the buttons size. | [
"Set",
"the",
"buttons",
"size",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java#L136-L145 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java | AbstractButton.setText | public void setText(String text) {
span.setText(text);
if (!span.isAttached()) {
add(span);
}
} | java | public void setText(String text) {
span.setText(text);
if (!span.isAttached()) {
add(span);
}
} | [
"public",
"void",
"setText",
"(",
"String",
"text",
")",
"{",
"span",
".",
"setText",
"(",
"text",
")",
";",
"if",
"(",
"!",
"span",
".",
"isAttached",
"(",
")",
")",
"{",
"add",
"(",
"span",
")",
";",
"}",
"}"
] | Set the buttons span text. | [
"Set",
"the",
"buttons",
"span",
"text",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/AbstractButton.java#L164-L170 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/helper/ColorHelper.java | ColorHelper.fromStyleName | public static <E extends Enum<? extends Style.HasCssName>> E fromStyleName(final String styleName,
final Class<E> enumClass,
final E defaultValue) {
retur... | java | public static <E extends Enum<? extends Style.HasCssName>> E fromStyleName(final String styleName,
final Class<E> enumClass,
final E defaultValue) {
retur... | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"?",
"extends",
"Style",
".",
"HasCssName",
">",
">",
"E",
"fromStyleName",
"(",
"final",
"String",
"styleName",
",",
"final",
"Class",
"<",
"E",
">",
"enumClass",
",",
"final",
"E",
"defaultValue",
"... | Returns first enum constant found..
@param styleName Space-separated list of styles
@param enumClass Type of enum
@param defaultValue Default value of no match was found
@return First enum constant found or default value | [
"Returns",
"first",
"enum",
"constant",
"found",
".."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/helper/ColorHelper.java#L40-L44 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/animate/MaterialAnimation.java | MaterialAnimation.stopAnimation | public void stopAnimation() {
if(widget != null) {
widget.removeStyleName("animated");
widget.removeStyleName(transition.getCssName());
widget.removeStyleName(CssName.INFINITE);
}
} | java | public void stopAnimation() {
if(widget != null) {
widget.removeStyleName("animated");
widget.removeStyleName(transition.getCssName());
widget.removeStyleName(CssName.INFINITE);
}
} | [
"public",
"void",
"stopAnimation",
"(",
")",
"{",
"if",
"(",
"widget",
"!=",
"null",
")",
"{",
"widget",
".",
"removeStyleName",
"(",
"\"animated\"",
")",
";",
"widget",
".",
"removeStyleName",
"(",
"transition",
".",
"getCssName",
"(",
")",
")",
";",
"w... | Stop an animation. | [
"Stop",
"an",
"animation",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/animate/MaterialAnimation.java#L182-L188 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java | MaterialValueBox.clear | public void clear() {
valueBoxBase.setText("");
clearStatusText();
if (getPlaceholder() == null || getPlaceholder().isEmpty()) {
label.removeStyleName(CssName.ACTIVE);
}
} | java | public void clear() {
valueBoxBase.setText("");
clearStatusText();
if (getPlaceholder() == null || getPlaceholder().isEmpty()) {
label.removeStyleName(CssName.ACTIVE);
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"valueBoxBase",
".",
"setText",
"(",
"\"\"",
")",
";",
"clearStatusText",
"(",
")",
";",
"if",
"(",
"getPlaceholder",
"(",
")",
"==",
"null",
"||",
"getPlaceholder",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"... | Resets the text box by removing its content and resetting visual state. | [
"Resets",
"the",
"text",
"box",
"by",
"removing",
"its",
"content",
"and",
"resetting",
"visual",
"state",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java#L154-L161 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java | MaterialValueBox.updateLabelActiveStyle | protected void updateLabelActiveStyle() {
if (this.valueBoxBase.getText() != null && !this.valueBoxBase.getText().isEmpty()) {
label.addStyleName(CssName.ACTIVE);
} else {
label.removeStyleName(CssName.ACTIVE);
}
} | java | protected void updateLabelActiveStyle() {
if (this.valueBoxBase.getText() != null && !this.valueBoxBase.getText().isEmpty()) {
label.addStyleName(CssName.ACTIVE);
} else {
label.removeStyleName(CssName.ACTIVE);
}
} | [
"protected",
"void",
"updateLabelActiveStyle",
"(",
")",
"{",
"if",
"(",
"this",
".",
"valueBoxBase",
".",
"getText",
"(",
")",
"!=",
"null",
"&&",
"!",
"this",
".",
"valueBoxBase",
".",
"getText",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"label",... | Updates the style of the field label according to the field value if the
field value is empty - null or "" - removes the label 'active' style else
will add the 'active' style to the field label. | [
"Updates",
"the",
"style",
"of",
"the",
"field",
"label",
"according",
"to",
"the",
"field",
"value",
"if",
"the",
"field",
"value",
"is",
"empty",
"-",
"null",
"or",
"-",
"removes",
"the",
"label",
"active",
"style",
"else",
"will",
"add",
"the",
"activ... | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java#L432-L438 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleBody.java | MaterialCollapsibleBody.checkActiveState | protected void checkActiveState(Widget child) {
// Check if this widget has a valid href
String href = child.getElement().getAttribute("href");
String url = Window.Location.getHref();
int pos = url.indexOf("#");
String location = pos >= 0 ? url.substring(pos, url.length()) : "";
... | java | protected void checkActiveState(Widget child) {
// Check if this widget has a valid href
String href = child.getElement().getAttribute("href");
String url = Window.Location.getHref();
int pos = url.indexOf("#");
String location = pos >= 0 ? url.substring(pos, url.length()) : "";
... | [
"protected",
"void",
"checkActiveState",
"(",
"Widget",
"child",
")",
"{",
"// Check if this widget has a valid href",
"String",
"href",
"=",
"child",
".",
"getElement",
"(",
")",
".",
"getAttribute",
"(",
"\"href\"",
")",
";",
"String",
"url",
"=",
"Window",
".... | Checks if this child holds the current active state.
If the child is or contains the active state it is applied. | [
"Checks",
"if",
"this",
"child",
"holds",
"the",
"current",
"active",
"state",
".",
"If",
"the",
"child",
"is",
"or",
"contains",
"the",
"active",
"state",
"it",
"is",
"applied",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleBody.java#L126-L144 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java | MaterialCollapsibleItem.setActive | @Override
public void setActive(boolean active) {
this.active = active;
if (parent != null) {
fireCollapsibleHandler();
removeStyleName(CssName.ACTIVE);
if (header != null) {
header.removeStyleName(CssName.ACTIVE);
}
if (ac... | java | @Override
public void setActive(boolean active) {
this.active = active;
if (parent != null) {
fireCollapsibleHandler();
removeStyleName(CssName.ACTIVE);
if (header != null) {
header.removeStyleName(CssName.ACTIVE);
}
if (ac... | [
"@",
"Override",
"public",
"void",
"setActive",
"(",
"boolean",
"active",
")",
"{",
"this",
".",
"active",
"=",
"active",
";",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"fireCollapsibleHandler",
"(",
")",
";",
"removeStyleName",
"(",
"CssName",
".",
"... | Make this item active. | [
"Make",
"this",
"item",
"active",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java#L148-L175 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java | MaterialDatePicker.setDateMin | public void setDateMin(Date dateMin) {
this.dateMin = dateMin;
if (isAttached() && dateMin != null) {
getPicker().set("min", JsDate.create((double) dateMin.getTime()));
}
} | java | public void setDateMin(Date dateMin) {
this.dateMin = dateMin;
if (isAttached() && dateMin != null) {
getPicker().set("min", JsDate.create((double) dateMin.getTime()));
}
} | [
"public",
"void",
"setDateMin",
"(",
"Date",
"dateMin",
")",
"{",
"this",
".",
"dateMin",
"=",
"dateMin",
";",
"if",
"(",
"isAttached",
"(",
")",
"&&",
"dateMin",
"!=",
"null",
")",
"{",
"getPicker",
"(",
")",
".",
"set",
"(",
"\"min\"",
",",
"JsDate... | Set the minimum date limit. | [
"Set",
"the",
"minimum",
"date",
"limit",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java#L228-L234 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java | MaterialDatePicker.setDateMax | public void setDateMax(Date dateMax) {
this.dateMax = dateMax;
if (isAttached() && dateMax != null) {
getPicker().set("max", JsDate.create((double) dateMax.getTime()));
}
} | java | public void setDateMax(Date dateMax) {
this.dateMax = dateMax;
if (isAttached() && dateMax != null) {
getPicker().set("max", JsDate.create((double) dateMax.getTime()));
}
} | [
"public",
"void",
"setDateMax",
"(",
"Date",
"dateMax",
")",
"{",
"this",
".",
"dateMax",
"=",
"dateMax",
";",
"if",
"(",
"isAttached",
"(",
")",
"&&",
"dateMax",
"!=",
"null",
")",
"{",
"getPicker",
"(",
")",
".",
"set",
"(",
"\"max\"",
",",
"JsDate... | Set the maximum date limit. | [
"Set",
"the",
"maximum",
"date",
"limit",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java#L246-L252 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java | MaterialDatePicker.getPickerDate | protected Date getPickerDate() {
try {
JsDate pickerDate = getPicker().get("select").obj;
return new Date((long) pickerDate.getTime());
} catch (Exception e) {
e.printStackTrace();
return null;
}
} | java | protected Date getPickerDate() {
try {
JsDate pickerDate = getPicker().get("select").obj;
return new Date((long) pickerDate.getTime());
} catch (Exception e) {
e.printStackTrace();
return null;
}
} | [
"protected",
"Date",
"getPickerDate",
"(",
")",
"{",
"try",
"{",
"JsDate",
"pickerDate",
"=",
"getPicker",
"(",
")",
".",
"get",
"(",
"\"select\"",
")",
".",
"obj",
";",
"return",
"new",
"Date",
"(",
"(",
"long",
")",
"pickerDate",
".",
"getTime",
"(",... | Get the pickers date. | [
"Get",
"the",
"pickers",
"date",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java#L270-L278 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java | MaterialDatePicker.setSelectionType | public void setSelectionType(MaterialDatePickerType selectionType) {
this.selectionType = selectionType;
switch (selectionType) {
case MONTH_DAY:
options.selectMonths = true;
break;
case YEAR_MONTH_DAY:
options.selectYears = yearsTo... | java | public void setSelectionType(MaterialDatePickerType selectionType) {
this.selectionType = selectionType;
switch (selectionType) {
case MONTH_DAY:
options.selectMonths = true;
break;
case YEAR_MONTH_DAY:
options.selectYears = yearsTo... | [
"public",
"void",
"setSelectionType",
"(",
"MaterialDatePickerType",
"selectionType",
")",
"{",
"this",
".",
"selectionType",
"=",
"selectionType",
";",
"switch",
"(",
"selectionType",
")",
"{",
"case",
"MONTH_DAY",
":",
"options",
".",
"selectMonths",
"=",
"true"... | Set the pickers selection type. | [
"Set",
"the",
"pickers",
"selection",
"type",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java#L312-L327 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java | MaterialDatePicker.setAutoClose | public void setAutoClose(boolean autoClose) {
this.autoClose = autoClose;
if (autoCloseHandlerRegistration != null) {
autoCloseHandlerRegistration.removeHandler();
autoCloseHandlerRegistration = null;
}
if (autoClose) {
autoCloseHandlerRegistration =... | java | public void setAutoClose(boolean autoClose) {
this.autoClose = autoClose;
if (autoCloseHandlerRegistration != null) {
autoCloseHandlerRegistration.removeHandler();
autoCloseHandlerRegistration = null;
}
if (autoClose) {
autoCloseHandlerRegistration =... | [
"public",
"void",
"setAutoClose",
"(",
"boolean",
"autoClose",
")",
"{",
"this",
".",
"autoClose",
"=",
"autoClose",
";",
"if",
"(",
"autoCloseHandlerRegistration",
"!=",
"null",
")",
"{",
"autoCloseHandlerRegistration",
".",
"removeHandler",
"(",
")",
";",
"aut... | Enables or disables auto closing when selecting a date. | [
"Enables",
"or",
"disables",
"auto",
"closing",
"when",
"selecting",
"a",
"date",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java#L555-L566 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/AbstractValueWidget.java | AbstractValueWidget.setAllowBlank | public void setAllowBlank(boolean allowBlank) {
this.allowBlank = allowBlank;
// Setup the allow blank validation
if (!allowBlank) {
if (blankValidator == null) {
blankValidator = createBlankValidator();
}
setupBlurValidation();
ad... | java | public void setAllowBlank(boolean allowBlank) {
this.allowBlank = allowBlank;
// Setup the allow blank validation
if (!allowBlank) {
if (blankValidator == null) {
blankValidator = createBlankValidator();
}
setupBlurValidation();
ad... | [
"public",
"void",
"setAllowBlank",
"(",
"boolean",
"allowBlank",
")",
"{",
"this",
".",
"allowBlank",
"=",
"allowBlank",
";",
"// Setup the allow blank validation",
"if",
"(",
"!",
"allowBlank",
")",
"{",
"if",
"(",
"blankValidator",
"==",
"null",
")",
"{",
"b... | Enable or disable the default blank validator. | [
"Enable",
"or",
"disable",
"the",
"default",
"blank",
"validator",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/AbstractValueWidget.java#L206-L219 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/mixin/ColorsMixin.java | ColorsMixin.ensureTextColorFormat | protected String ensureTextColorFormat(String textColor) {
String formatted = "";
boolean mainColor = true;
for (String style : textColor.split(" ")) {
if (mainColor) {
// the main color
if (!style.endsWith("-text")) {
style += "-te... | java | protected String ensureTextColorFormat(String textColor) {
String formatted = "";
boolean mainColor = true;
for (String style : textColor.split(" ")) {
if (mainColor) {
// the main color
if (!style.endsWith("-text")) {
style += "-te... | [
"protected",
"String",
"ensureTextColorFormat",
"(",
"String",
"textColor",
")",
"{",
"String",
"formatted",
"=",
"\"\"",
";",
"boolean",
"mainColor",
"=",
"true",
";",
"for",
"(",
"String",
"style",
":",
"textColor",
".",
"split",
"(",
"\" \"",
")",
")",
... | Allow for the use of text shading and auto formatting. | [
"Allow",
"for",
"the",
"use",
"of",
"text",
"shading",
"and",
"auto",
"formatting",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/mixin/ColorsMixin.java#L76-L95 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTabItem.java | MaterialTabItem.selectTab | public void selectTab() {
for (Widget child : getChildren()) {
if (child instanceof HasHref) {
String href = ((HasHref) child).getHref();
if (parent != null && !href.isEmpty()) {
parent.selectTab(href.replaceAll("[^a-zA-Z\\d\\s:]", ""));
... | java | public void selectTab() {
for (Widget child : getChildren()) {
if (child instanceof HasHref) {
String href = ((HasHref) child).getHref();
if (parent != null && !href.isEmpty()) {
parent.selectTab(href.replaceAll("[^a-zA-Z\\d\\s:]", ""));
... | [
"public",
"void",
"selectTab",
"(",
")",
"{",
"for",
"(",
"Widget",
"child",
":",
"getChildren",
"(",
")",
")",
"{",
"if",
"(",
"child",
"instanceof",
"HasHref",
")",
"{",
"String",
"href",
"=",
"(",
"(",
"HasHref",
")",
"child",
")",
".",
"getHref",... | Select this tab item. | [
"Select",
"this",
"tab",
"item",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTabItem.java#L64-L75 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/validator/MessageFormat.java | MessageFormat.format | public static String format(String pattern, Object... arguments) {
String msg = pattern;
if (arguments != null) {
for (int index = 0; index < arguments.length; index++) {
msg = msg.replaceAll("\\{" + (index + 1) + "\\}", String.valueOf(arguments[index]));
}
... | java | public static String format(String pattern, Object... arguments) {
String msg = pattern;
if (arguments != null) {
for (int index = 0; index < arguments.length; index++) {
msg = msg.replaceAll("\\{" + (index + 1) + "\\}", String.valueOf(arguments[index]));
}
... | [
"public",
"static",
"String",
"format",
"(",
"String",
"pattern",
",",
"Object",
"...",
"arguments",
")",
"{",
"String",
"msg",
"=",
"pattern",
";",
"if",
"(",
"arguments",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"... | Format the message using the pattern and the arguments.
@param pattern the pattern in the format of "{1} this is a {2}"
@param arguments the arguments.
@return the formatted result. | [
"Format",
"the",
"message",
"using",
"the",
"pattern",
"and",
"the",
"arguments",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/validator/MessageFormat.java#L36-L44 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSwitch.java | MaterialSwitch.setValue | @Override
public void setValue(Boolean value, boolean fireEvents) {
boolean oldValue = getValue();
if (value) {
input.getElement().setAttribute("checked", "true");
} else {
input.getElement().removeAttribute("checked");
}
if (fireEvents && oldValue !=... | java | @Override
public void setValue(Boolean value, boolean fireEvents) {
boolean oldValue = getValue();
if (value) {
input.getElement().setAttribute("checked", "true");
} else {
input.getElement().removeAttribute("checked");
}
if (fireEvents && oldValue !=... | [
"@",
"Override",
"public",
"void",
"setValue",
"(",
"Boolean",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"boolean",
"oldValue",
"=",
"getValue",
"(",
")",
";",
"if",
"(",
"value",
")",
"{",
"input",
".",
"getElement",
"(",
")",
".",
"setAttribute"... | Set the value of switch component. | [
"Set",
"the",
"value",
"of",
"switch",
"component",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSwitch.java#L124-L136 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/helper/StyleHelper.java | StyleHelper.addUniqueEnumStyleName | public static <E extends Style.HasCssName, F extends Enum<? extends Style.HasCssName>> void addUniqueEnumStyleName(final UIObject uiObject,
final Class<F> enumClass,
... | java | public static <E extends Style.HasCssName, F extends Enum<? extends Style.HasCssName>> void addUniqueEnumStyleName(final UIObject uiObject,
final Class<F> enumClass,
... | [
"public",
"static",
"<",
"E",
"extends",
"Style",
".",
"HasCssName",
",",
"F",
"extends",
"Enum",
"<",
"?",
"extends",
"Style",
".",
"HasCssName",
">",
">",
"void",
"addUniqueEnumStyleName",
"(",
"final",
"UIObject",
"uiObject",
",",
"final",
"Class",
"<",
... | Convenience method for first removing all enum style constants and then adding the single one.
@see #removeEnumStyleNames(UIObject, Class)
@see #addEnumStyleName(UIObject, Style.HasCssName) | [
"Convenience",
"method",
"for",
"first",
"removing",
"all",
"enum",
"style",
"constants",
"and",
"then",
"adding",
"the",
"single",
"one",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/helper/StyleHelper.java#L45-L50 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/helper/StyleHelper.java | StyleHelper.toggleStyleName | public static void toggleStyleName(final UIObject uiObject,
final boolean toggleStyle,
final String styleName) {
if (toggleStyle) {
uiObject.addStyleName(styleName);
} else {
uiObject.removeStyleName(st... | java | public static void toggleStyleName(final UIObject uiObject,
final boolean toggleStyle,
final String styleName) {
if (toggleStyle) {
uiObject.addStyleName(styleName);
} else {
uiObject.removeStyleName(st... | [
"public",
"static",
"void",
"toggleStyleName",
"(",
"final",
"UIObject",
"uiObject",
",",
"final",
"boolean",
"toggleStyle",
",",
"final",
"String",
"styleName",
")",
"{",
"if",
"(",
"toggleStyle",
")",
"{",
"uiObject",
".",
"addStyleName",
"(",
"styleName",
"... | Toggles a style name on a ui object
@param uiObject Object to toggle style on
@param toggleStyle whether or not to toggle the style name on the object
@param styleName Style name | [
"Toggles",
"a",
"style",
"name",
"on",
"a",
"ui",
"object"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/helper/StyleHelper.java#L130-L138 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/pwa/serviceworker/ServiceWorkerManager.java | ServiceWorkerManager.setupRegistration | protected void setupRegistration() {
if (isServiceWorkerSupported()) {
Navigator.serviceWorker.register(getResource()).then(object -> {
logger.info("Service worker has been successfully registered");
registration = (ServiceWorkerRegistration) object;
... | java | protected void setupRegistration() {
if (isServiceWorkerSupported()) {
Navigator.serviceWorker.register(getResource()).then(object -> {
logger.info("Service worker has been successfully registered");
registration = (ServiceWorkerRegistration) object;
... | [
"protected",
"void",
"setupRegistration",
"(",
")",
"{",
"if",
"(",
"isServiceWorkerSupported",
"(",
")",
")",
"{",
"Navigator",
".",
"serviceWorker",
".",
"register",
"(",
"getResource",
"(",
")",
")",
".",
"then",
"(",
"object",
"->",
"{",
"logger",
".",... | Initial setup of the service worker registration. | [
"Initial",
"setup",
"of",
"the",
"service",
"worker",
"registration",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/pwa/serviceworker/ServiceWorkerManager.java#L103-L126 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialRange.java | MaterialRange.addChangeHandler | @Override
public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
return getRangeInputElement().addDomHandler(handler, ChangeEvent.getType());
} | java | @Override
public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
return getRangeInputElement().addDomHandler(handler, ChangeEvent.getType());
} | [
"@",
"Override",
"public",
"HandlerRegistration",
"addChangeHandler",
"(",
"final",
"ChangeHandler",
"handler",
")",
"{",
"return",
"getRangeInputElement",
"(",
")",
".",
"addDomHandler",
"(",
"handler",
",",
"ChangeEvent",
".",
"getType",
"(",
")",
")",
";",
"}... | Register the ChangeHandler to become notified if the user changes the slider.
The Handler is called when the user releases the mouse only at the end of the slide
operation. | [
"Register",
"the",
"ChangeHandler",
"to",
"become",
"notified",
"if",
"the",
"user",
"changes",
"the",
"slider",
".",
"The",
"Handler",
"is",
"called",
"when",
"the",
"user",
"releases",
"the",
"mouse",
"only",
"at",
"the",
"end",
"of",
"the",
"slide",
"op... | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialRange.java#L221-L224 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/viewport/ViewPortHandler.java | ViewPortHandler.then | public ViewPort then(Functions.Func1<ViewPortChange> then, ViewPortFallback fallback) {
assert then != null : "'then' callback cannot be null";
this.then = then;
this.fallback = fallback;
return load();
} | java | public ViewPort then(Functions.Func1<ViewPortChange> then, ViewPortFallback fallback) {
assert then != null : "'then' callback cannot be null";
this.then = then;
this.fallback = fallback;
return load();
} | [
"public",
"ViewPort",
"then",
"(",
"Functions",
".",
"Func1",
"<",
"ViewPortChange",
">",
"then",
",",
"ViewPortFallback",
"fallback",
")",
"{",
"assert",
"then",
"!=",
"null",
":",
"\"'then' callback cannot be null\"",
";",
"this",
".",
"then",
"=",
"then",
"... | Load the view port execution.
@param then callback when the view port is detected.
@param fallback fallback when no view port detected or failure to detect the given
{@link Boundary} (using {@link #propagateFallback(boolean)}) | [
"Load",
"the",
"view",
"port",
"execution",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/viewport/ViewPortHandler.java#L83-L88 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/viewport/ViewPortHandler.java | ViewPortHandler.load | protected ViewPort load() {
resize = Window.addResizeHandler(event -> {
execute(event.getWidth(), event.getHeight());
});
execute(window().width(), (int)window().height());
return viewPort;
} | java | protected ViewPort load() {
resize = Window.addResizeHandler(event -> {
execute(event.getWidth(), event.getHeight());
});
execute(window().width(), (int)window().height());
return viewPort;
} | [
"protected",
"ViewPort",
"load",
"(",
")",
"{",
"resize",
"=",
"Window",
".",
"addResizeHandler",
"(",
"event",
"->",
"{",
"execute",
"(",
"event",
".",
"getWidth",
"(",
")",
",",
"event",
".",
"getHeight",
"(",
")",
")",
";",
"}",
")",
";",
"execute... | Load the windows resize handler with initial view port detection. | [
"Load",
"the",
"windows",
"resize",
"handler",
"with",
"initial",
"view",
"port",
"detection",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/viewport/ViewPortHandler.java#L112-L119 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/helper/DateFormatHelper.java | DateFormatHelper.format | public static String format(String format) {
if (format == null) {
format = DEFAULT_FORMAT;
} else {
if (format.contains("M")) {
format = format.replace("M", "m");
}
if (format.contains("Y")) {
format = format.replace("Y",... | java | public static String format(String format) {
if (format == null) {
format = DEFAULT_FORMAT;
} else {
if (format.contains("M")) {
format = format.replace("M", "m");
}
if (format.contains("Y")) {
format = format.replace("Y",... | [
"public",
"static",
"String",
"format",
"(",
"String",
"format",
")",
"{",
"if",
"(",
"format",
"==",
"null",
")",
"{",
"format",
"=",
"DEFAULT_FORMAT",
";",
"}",
"else",
"{",
"if",
"(",
"format",
".",
"contains",
"(",
"\"M\"",
")",
")",
"{",
"format... | Will auto format the given string to provide support for pickadate.js formats. | [
"Will",
"auto",
"format",
"the",
"given",
"string",
"to",
"provide",
"support",
"for",
"pickadate",
".",
"js",
"formats",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/helper/DateFormatHelper.java#L36-L54 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/AbstractSideNav.java | AbstractSideNav.setWidth | public void setWidth(int width) {
this.width = width;
getElement().getStyle().setWidth(width, Style.Unit.PX);
} | java | public void setWidth(int width) {
this.width = width;
getElement().getStyle().setWidth(width, Style.Unit.PX);
} | [
"public",
"void",
"setWidth",
"(",
"int",
"width",
")",
"{",
"this",
".",
"width",
"=",
"width",
";",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setWidth",
"(",
"width",
",",
"Style",
".",
"Unit",
".",
"PX",
")",
";",
"}"
] | Set the menu's width in pixels. | [
"Set",
"the",
"menu",
"s",
"width",
"in",
"pixels",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/AbstractSideNav.java#L354-L357 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsible.java | MaterialCollapsible.setAccordion | public void setAccordion(boolean accordion) {
getElement().setAttribute("data-collapsible", accordion ? CssName.ACCORDION : CssName.EXPANDABLE);
reload();
} | java | public void setAccordion(boolean accordion) {
getElement().setAttribute("data-collapsible", accordion ? CssName.ACCORDION : CssName.EXPANDABLE);
reload();
} | [
"public",
"void",
"setAccordion",
"(",
"boolean",
"accordion",
")",
"{",
"getElement",
"(",
")",
".",
"setAttribute",
"(",
"\"data-collapsible\"",
",",
"accordion",
"?",
"CssName",
".",
"ACCORDION",
":",
"CssName",
".",
"EXPANDABLE",
")",
";",
"reload",
"(",
... | Configure if you want this collapsible container to
accordion its child elements or use expandable. | [
"Configure",
"if",
"you",
"want",
"this",
"collapsible",
"container",
"to",
"accordion",
"its",
"child",
"elements",
"or",
"use",
"expandable",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsible.java#L237-L240 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/validator/AbstractValidator.java | AbstractValidator.getInvalidMessage | public String getInvalidMessage(String key) {
return invalidMessageOverride == null ? messageMixin.lookup(key, messageValueArgs) : MessageFormat.format(
invalidMessageOverride, messageValueArgs);
} | java | public String getInvalidMessage(String key) {
return invalidMessageOverride == null ? messageMixin.lookup(key, messageValueArgs) : MessageFormat.format(
invalidMessageOverride, messageValueArgs);
} | [
"public",
"String",
"getInvalidMessage",
"(",
"String",
"key",
")",
"{",
"return",
"invalidMessageOverride",
"==",
"null",
"?",
"messageMixin",
".",
"lookup",
"(",
"key",
",",
"messageValueArgs",
")",
":",
"MessageFormat",
".",
"format",
"(",
"invalidMessageOverri... | Gets the invalid message.
@param key the key
@return the invalid message | [
"Gets",
"the",
"invalid",
"message",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/validator/AbstractValidator.java#L90-L93 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/pwa/PwaManager.java | PwaManager.installApp | public void installApp(Functions.Func callback) {
if (isPwaSupported()) {
appInstaller = new AppInstaller(callback);
appInstaller.prompt();
}
} | java | public void installApp(Functions.Func callback) {
if (isPwaSupported()) {
appInstaller = new AppInstaller(callback);
appInstaller.prompt();
}
} | [
"public",
"void",
"installApp",
"(",
"Functions",
".",
"Func",
"callback",
")",
"{",
"if",
"(",
"isPwaSupported",
"(",
")",
")",
"{",
"appInstaller",
"=",
"new",
"AppInstaller",
"(",
"callback",
")",
";",
"appInstaller",
".",
"prompt",
"(",
")",
";",
"}"... | Will prompt a user the "Add to Homescreen" feature
@param callback A callback function after the method has been executed. | [
"Will",
"prompt",
"a",
"user",
"the",
"Add",
"to",
"Homescreen",
"feature"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/pwa/PwaManager.java#L133-L138 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialLoader.java | MaterialLoader.show | public void show() {
if (!(container instanceof RootPanel)) {
if (!(container instanceof MaterialDialog)) {
container.getElement().getStyle().setPosition(Style.Position.RELATIVE);
}
div.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
}
... | java | public void show() {
if (!(container instanceof RootPanel)) {
if (!(container instanceof MaterialDialog)) {
container.getElement().getStyle().setPosition(Style.Position.RELATIVE);
}
div.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
}
... | [
"public",
"void",
"show",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"container",
"instanceof",
"RootPanel",
")",
")",
"{",
"if",
"(",
"!",
"(",
"container",
"instanceof",
"MaterialDialog",
")",
")",
"{",
"container",
".",
"getElement",
"(",
")",
".",
"getSty... | Shows the Loader component | [
"Shows",
"the",
"Loader",
"component"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialLoader.java#L100-L119 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialLoader.java | MaterialLoader.hide | public void hide() {
div.removeFromParent();
if (scrollDisabled) {
RootPanel.get().getElement().getStyle().setOverflow(Style.Overflow.AUTO);
}
if (type == LoaderType.CIRCULAR) {
preLoader.removeFromParent();
} else if (type == LoaderType.PROGRESS) {
... | java | public void hide() {
div.removeFromParent();
if (scrollDisabled) {
RootPanel.get().getElement().getStyle().setOverflow(Style.Overflow.AUTO);
}
if (type == LoaderType.CIRCULAR) {
preLoader.removeFromParent();
} else if (type == LoaderType.PROGRESS) {
... | [
"public",
"void",
"hide",
"(",
")",
"{",
"div",
".",
"removeFromParent",
"(",
")",
";",
"if",
"(",
"scrollDisabled",
")",
"{",
"RootPanel",
".",
"get",
"(",
")",
".",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setOverflow",
"(",
"Style"... | Hides the Loader component | [
"Hides",
"the",
"Loader",
"component"
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialLoader.java#L124-L134 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/base/Waves.java | Waves.detectAndApply | public static void detectAndApply(Widget widget) {
if (!widget.isAttached()) {
widget.addAttachHandler(event -> {
if (event.isAttached()) {
detectAndApply();
}
});
} else {
detectAndApply();
}
} | java | public static void detectAndApply(Widget widget) {
if (!widget.isAttached()) {
widget.addAttachHandler(event -> {
if (event.isAttached()) {
detectAndApply();
}
});
} else {
detectAndApply();
}
} | [
"public",
"static",
"void",
"detectAndApply",
"(",
"Widget",
"widget",
")",
"{",
"if",
"(",
"!",
"widget",
".",
"isAttached",
"(",
")",
")",
"{",
"widget",
".",
"addAttachHandler",
"(",
"event",
"->",
"{",
"if",
"(",
"event",
".",
"isAttached",
"(",
")... | Detect and apply waves, now or when the widget is attached.
@param widget target widget to ensure is attached first | [
"Detect",
"and",
"apply",
"waves",
"now",
"or",
"when",
"the",
"widget",
"is",
"attached",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/base/Waves.java#L42-L52 | train |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCheckBox.java | MaterialCheckBox.setType | public void setType(CheckBoxType type) {
this.type = type;
switch (type) {
case FILLED:
Element input = DOM.getChild(getElement(), 0);
input.setAttribute("class", CssName.FILLED_IN);
break;
case INTERMEDIATE:
addStyl... | java | public void setType(CheckBoxType type) {
this.type = type;
switch (type) {
case FILLED:
Element input = DOM.getChild(getElement(), 0);
input.setAttribute("class", CssName.FILLED_IN);
break;
case INTERMEDIATE:
addStyl... | [
"public",
"void",
"setType",
"(",
"CheckBoxType",
"type",
")",
"{",
"this",
".",
"type",
"=",
"type",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"FILLED",
":",
"Element",
"input",
"=",
"DOM",
".",
"getChild",
"(",
"getElement",
"(",
")",
",",
"0",... | Setting the type of Checkbox. | [
"Setting",
"the",
"type",
"of",
"Checkbox",
"."
] | 86feefb282b007c0a44784c09e651a50f257138e | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCheckBox.java#L148-L162 | train |
eed3si9n/scalaxb | mvn-scalaxb/src/main/java/org/scalaxb/maven/ArgumentsBuilder.java | ArgumentsBuilder.param | ArgumentsBuilder param(String param, Integer value) {
if (value != null) {
args.add(param);
args.add(value.toString());
}
return this;
} | java | ArgumentsBuilder param(String param, Integer value) {
if (value != null) {
args.add(param);
args.add(value.toString());
}
return this;
} | [
"ArgumentsBuilder",
"param",
"(",
"String",
"param",
",",
"Integer",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"args",
".",
"add",
"(",
"param",
")",
";",
"args",
".",
"add",
"(",
"value",
".",
"toString",
"(",
")",
")",
";",
... | Adds a parameter to the argument list if the given integer is non-null.
If the value is null, then the argument list remains unchanged. | [
"Adds",
"a",
"parameter",
"to",
"the",
"argument",
"list",
"if",
"the",
"given",
"integer",
"is",
"non",
"-",
"null",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"argument",
"list",
"remains",
"unchanged",
"."
] | 92e8a5127e48ba594caca34685dda6dafcd21dd9 | https://github.com/eed3si9n/scalaxb/blob/92e8a5127e48ba594caca34685dda6dafcd21dd9/mvn-scalaxb/src/main/java/org/scalaxb/maven/ArgumentsBuilder.java#L68-L74 | train |
eed3si9n/scalaxb | mvn-scalaxb/src/main/java/org/scalaxb/maven/ArgumentsBuilder.java | ArgumentsBuilder.param | ArgumentsBuilder param(String param, String value) {
if (value != null) {
args.add(param);
args.add(value);
}
return this;
} | java | ArgumentsBuilder param(String param, String value) {
if (value != null) {
args.add(param);
args.add(value);
}
return this;
} | [
"ArgumentsBuilder",
"param",
"(",
"String",
"param",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"args",
".",
"add",
"(",
"param",
")",
";",
"args",
".",
"add",
"(",
"value",
")",
";",
"}",
"return",
"this",
";",
... | Adds a parameter that requires a string argument to the argument list.
If the given argument is null, then the argument list remains unchanged. | [
"Adds",
"a",
"parameter",
"that",
"requires",
"a",
"string",
"argument",
"to",
"the",
"argument",
"list",
".",
"If",
"the",
"given",
"argument",
"is",
"null",
"then",
"the",
"argument",
"list",
"remains",
"unchanged",
"."
] | 92e8a5127e48ba594caca34685dda6dafcd21dd9 | https://github.com/eed3si9n/scalaxb/blob/92e8a5127e48ba594caca34685dda6dafcd21dd9/mvn-scalaxb/src/main/java/org/scalaxb/maven/ArgumentsBuilder.java#L80-L86 | train |
eed3si9n/scalaxb | mvn-scalaxb/src/main/java/org/scalaxb/maven/AbstractScalaxbMojo.java | AbstractScalaxbMojo.arguments | protected List<String> arguments() {
List<String> args = new ArgumentsBuilder()
.flag("-v", verbose)
.flag("--package-dir", packageDir)
.param("-d", outputDirectory.getPath())
.param("-p", packageName)
.map("--package:", packageNameMap())
.... | java | protected List<String> arguments() {
List<String> args = new ArgumentsBuilder()
.flag("-v", verbose)
.flag("--package-dir", packageDir)
.param("-d", outputDirectory.getPath())
.param("-p", packageName)
.map("--package:", packageNameMap())
.... | [
"protected",
"List",
"<",
"String",
">",
"arguments",
"(",
")",
"{",
"List",
"<",
"String",
">",
"args",
"=",
"new",
"ArgumentsBuilder",
"(",
")",
".",
"flag",
"(",
"\"-v\"",
",",
"verbose",
")",
".",
"flag",
"(",
"\"--package-dir\"",
",",
"packageDir",
... | Returns the command line options to be used for scalaxb, excluding the
input file names. | [
"Returns",
"the",
"command",
"line",
"options",
"to",
"be",
"used",
"for",
"scalaxb",
"excluding",
"the",
"input",
"file",
"names",
"."
] | 92e8a5127e48ba594caca34685dda6dafcd21dd9 | https://github.com/eed3si9n/scalaxb/blob/92e8a5127e48ba594caca34685dda6dafcd21dd9/mvn-scalaxb/src/main/java/org/scalaxb/maven/AbstractScalaxbMojo.java#L313-L342 | train |
eed3si9n/scalaxb | mvn-scalaxb/src/main/java/org/scalaxb/maven/AbstractScalaxbMojo.java | AbstractScalaxbMojo.packageNameMap | Map<String, String> packageNameMap() {
if (packageNames == null) {
return emptyMap();
}
Map<String, String> names = new LinkedHashMap<String, String>();
for (PackageName name : packageNames) {
names.put(name.getUri(), name.getPackage());
}
return ... | java | Map<String, String> packageNameMap() {
if (packageNames == null) {
return emptyMap();
}
Map<String, String> names = new LinkedHashMap<String, String>();
for (PackageName name : packageNames) {
names.put(name.getUri(), name.getPackage());
}
return ... | [
"Map",
"<",
"String",
",",
"String",
">",
"packageNameMap",
"(",
")",
"{",
"if",
"(",
"packageNames",
"==",
"null",
")",
"{",
"return",
"emptyMap",
"(",
")",
";",
"}",
"Map",
"<",
"String",
",",
"String",
">",
"names",
"=",
"new",
"LinkedHashMap",
"<... | Returns a map of URIs to package name, as specified by the packageNames
parameter. | [
"Returns",
"a",
"map",
"of",
"URIs",
"to",
"package",
"name",
"as",
"specified",
"by",
"the",
"packageNames",
"parameter",
"."
] | 92e8a5127e48ba594caca34685dda6dafcd21dd9 | https://github.com/eed3si9n/scalaxb/blob/92e8a5127e48ba594caca34685dda6dafcd21dd9/mvn-scalaxb/src/main/java/org/scalaxb/maven/AbstractScalaxbMojo.java#L348-L358 | train |
pushtorefresh/storio | storio-common/src/main/java/com/pushtorefresh/storio3/Queries.java | Queries.placeholders | @NonNull
public static String placeholders(final int numberOfPlaceholders) {
if (numberOfPlaceholders == 1) {
return "?"; // fffast
} else if (numberOfPlaceholders == 0) {
return "";
} else if (numberOfPlaceholders < 0) {
throw new IllegalArgumentException... | java | @NonNull
public static String placeholders(final int numberOfPlaceholders) {
if (numberOfPlaceholders == 1) {
return "?"; // fffast
} else if (numberOfPlaceholders == 0) {
return "";
} else if (numberOfPlaceholders < 0) {
throw new IllegalArgumentException... | [
"@",
"NonNull",
"public",
"static",
"String",
"placeholders",
"(",
"final",
"int",
"numberOfPlaceholders",
")",
"{",
"if",
"(",
"numberOfPlaceholders",
"==",
"1",
")",
"{",
"return",
"\"?\"",
";",
"// fffast",
"}",
"else",
"if",
"(",
"numberOfPlaceholders",
"=... | Generates required number of placeholders as string.
Example: {@code numberOfPlaceholders == 1, result == "?"},
{@code numberOfPlaceholders == 2, result == "?,?"}.
@param numberOfPlaceholders required amount of placeholders, should be {@code > 0}.
@return string with placeholders. | [
"Generates",
"required",
"number",
"of",
"placeholders",
"as",
"string",
"."
] | 58f53d81bcc7b069c8bb271c46a90e37775abe8d | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-common/src/main/java/com/pushtorefresh/storio3/Queries.java#L23-L44 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/spi/Association.java | Association.get | public Tuple get(RowKey key) {
AssociationOperation result = currentState.get( key );
if ( result == null ) {
return cleared ? null : snapshot.get( key );
}
else if ( result.getType() == REMOVE ) {
return null;
}
return result.getValue();
} | java | public Tuple get(RowKey key) {
AssociationOperation result = currentState.get( key );
if ( result == null ) {
return cleared ? null : snapshot.get( key );
}
else if ( result.getType() == REMOVE ) {
return null;
}
return result.getValue();
} | [
"public",
"Tuple",
"get",
"(",
"RowKey",
"key",
")",
"{",
"AssociationOperation",
"result",
"=",
"currentState",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"cleared",
"?",
"null",
":",
"snapshot",
".",
"get... | Returns the association row with the given key.
@param key the key of the row to return.
@return the association row with the given key or {@code null} if no row with that key is contained in this
association | [
"Returns",
"the",
"association",
"row",
"with",
"the",
"given",
"key",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/spi/Association.java#L66-L75 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/spi/Association.java | Association.remove | public void remove(RowKey key) {
currentState.put( key, new AssociationOperation( key, null, REMOVE ) );
} | java | public void remove(RowKey key) {
currentState.put( key, new AssociationOperation( key, null, REMOVE ) );
} | [
"public",
"void",
"remove",
"(",
"RowKey",
"key",
")",
"{",
"currentState",
".",
"put",
"(",
"key",
",",
"new",
"AssociationOperation",
"(",
"key",
",",
"null",
",",
"REMOVE",
")",
")",
";",
"}"
] | Removes the row with the specified key from this association.
@param key the key of the association row to remove | [
"Removes",
"the",
"row",
"with",
"the",
"specified",
"key",
"from",
"this",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/spi/Association.java#L96-L98 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/spi/Association.java | Association.isEmpty | public boolean isEmpty() {
int snapshotSize = cleared ? 0 : snapshot.size();
//nothing in both
if ( snapshotSize == 0 && currentState.isEmpty() ) {
return true;
}
//snapshot bigger than changeset
if ( snapshotSize > currentState.size() ) {
return false;
}
return size() == 0;
} | java | public boolean isEmpty() {
int snapshotSize = cleared ? 0 : snapshot.size();
//nothing in both
if ( snapshotSize == 0 && currentState.isEmpty() ) {
return true;
}
//snapshot bigger than changeset
if ( snapshotSize > currentState.size() ) {
return false;
}
return size() == 0;
} | [
"public",
"boolean",
"isEmpty",
"(",
")",
"{",
"int",
"snapshotSize",
"=",
"cleared",
"?",
"0",
":",
"snapshot",
".",
"size",
"(",
")",
";",
"//nothing in both",
"if",
"(",
"snapshotSize",
"==",
"0",
"&&",
"currentState",
".",
"isEmpty",
"(",
")",
")",
... | Whether this association contains no rows.
@return {@code true} if this association contains no rows, {@code false} otherwise | [
"Whether",
"this",
"association",
"contains",
"no",
"rows",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/spi/Association.java#L132-L143 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/spi/Association.java | Association.size | public int size() {
int size = cleared ? 0 : snapshot.size();
for ( Map.Entry<RowKey,AssociationOperation> op : currentState.entrySet() ) {
switch ( op.getValue().getType() ) {
case PUT:
if ( cleared || !snapshot.containsKey( op.getKey() ) ) {
size++;
}
break;
case REMOVE:
if ( ... | java | public int size() {
int size = cleared ? 0 : snapshot.size();
for ( Map.Entry<RowKey,AssociationOperation> op : currentState.entrySet() ) {
switch ( op.getValue().getType() ) {
case PUT:
if ( cleared || !snapshot.containsKey( op.getKey() ) ) {
size++;
}
break;
case REMOVE:
if ( ... | [
"public",
"int",
"size",
"(",
")",
"{",
"int",
"size",
"=",
"cleared",
"?",
"0",
":",
"snapshot",
".",
"size",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"RowKey",
",",
"AssociationOperation",
">",
"op",
":",
"currentState",
".",
"entrySet"... | Returns the number of rows within this association.
@return the number of rows within this association | [
"Returns",
"the",
"number",
"of",
"rows",
"within",
"this",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/spi/Association.java#L150-L167 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/spi/Association.java | Association.getKeys | public Iterable<RowKey> getKeys() {
if ( currentState.isEmpty() ) {
if ( cleared ) {
// if the association has been cleared and the currentState is empty, we consider that there are no rows.
return Collections.emptyList();
}
else {
// otherwise, the snapshot rows are the current ones
return s... | java | public Iterable<RowKey> getKeys() {
if ( currentState.isEmpty() ) {
if ( cleared ) {
// if the association has been cleared and the currentState is empty, we consider that there are no rows.
return Collections.emptyList();
}
else {
// otherwise, the snapshot rows are the current ones
return s... | [
"public",
"Iterable",
"<",
"RowKey",
">",
"getKeys",
"(",
")",
"{",
"if",
"(",
"currentState",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"cleared",
")",
"{",
"// if the association has been cleared and the currentState is empty, we consider that there are no rows."... | Returns all keys of all rows contained within this association.
@return all keys of all rows contained within this association | [
"Returns",
"all",
"keys",
"of",
"all",
"rows",
"contained",
"within",
"this",
"association",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/spi/Association.java#L174-L209 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/key/spi/RowKey.java | RowKey.getColumnValue | public Object getColumnValue(String columnName) {
for ( int j = 0; j < columnNames.length; j++ ) {
if ( columnNames[j].equals( columnName ) ) {
return columnValues[j];
}
}
return null;
} | java | public Object getColumnValue(String columnName) {
for ( int j = 0; j < columnNames.length; j++ ) {
if ( columnNames[j].equals( columnName ) ) {
return columnValues[j];
}
}
return null;
} | [
"public",
"Object",
"getColumnValue",
"(",
"String",
"columnName",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"columnNames",
".",
"length",
";",
"j",
"++",
")",
"{",
"if",
"(",
"columnNames",
"[",
"j",
"]",
".",
"equals",
"(",
"colu... | Get the value of the specified column.
@param columnName the name of the column
@return the corresponding value of the column, {@code null} if the column does not exist in the row key | [
"Get",
"the",
"value",
"of",
"the",
"specified",
"column",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/key/spi/RowKey.java#L57-L64 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/key/spi/RowKey.java | RowKey.contains | public boolean contains(String column) {
for ( String columnName : columnNames ) {
if ( columnName.equals( column ) ) {
return true;
}
}
return false;
} | java | public boolean contains(String column) {
for ( String columnName : columnNames ) {
if ( columnName.equals( column ) ) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"contains",
"(",
"String",
"column",
")",
"{",
"for",
"(",
"String",
"columnName",
":",
"columnNames",
")",
"{",
"if",
"(",
"columnName",
".",
"equals",
"(",
"column",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"fals... | Check if a column is part of the row key columns.
@param column the name of the column to check
@return true if the column is one of the row key columns, false otherwise | [
"Check",
"if",
"a",
"column",
"is",
"part",
"of",
"the",
"row",
"key",
"columns",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/key/spi/RowKey.java#L72-L79 | train |
hibernate/hibernate-ogm | infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/configuration/impl/InfinispanRemoteConfiguration.java | InfinispanRemoteConfiguration.loadResourceFile | private void loadResourceFile(URL configurationResourceUrl, Properties hotRodConfiguration) {
if ( configurationResourceUrl != null ) {
try ( InputStream openStream = configurationResourceUrl.openStream() ) {
hotRodConfiguration.load( openStream );
}
catch (IOException e) {
throw log.failedLoadingHot... | java | private void loadResourceFile(URL configurationResourceUrl, Properties hotRodConfiguration) {
if ( configurationResourceUrl != null ) {
try ( InputStream openStream = configurationResourceUrl.openStream() ) {
hotRodConfiguration.load( openStream );
}
catch (IOException e) {
throw log.failedLoadingHot... | [
"private",
"void",
"loadResourceFile",
"(",
"URL",
"configurationResourceUrl",
",",
"Properties",
"hotRodConfiguration",
")",
"{",
"if",
"(",
"configurationResourceUrl",
"!=",
"null",
")",
"{",
"try",
"(",
"InputStream",
"openStream",
"=",
"configurationResourceUrl",
... | Load the properties from the resource file if one is specified | [
"Load",
"the",
"properties",
"from",
"the",
"resource",
"file",
"if",
"one",
"is",
"specified"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/configuration/impl/InfinispanRemoteConfiguration.java#L276-L285 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/options/navigation/source/impl/OptionValueSources.java | OptionValueSources.invokeOptionConfigurator | private static <D extends DatastoreConfiguration<G>, G extends GlobalContext<?, ?>> AppendableConfigurationContext invokeOptionConfigurator(
OptionConfigurator configurator) {
ConfigurableImpl configurable = new ConfigurableImpl();
configurator.configure( configurable );
return configurable.getContext();
} | java | private static <D extends DatastoreConfiguration<G>, G extends GlobalContext<?, ?>> AppendableConfigurationContext invokeOptionConfigurator(
OptionConfigurator configurator) {
ConfigurableImpl configurable = new ConfigurableImpl();
configurator.configure( configurable );
return configurable.getContext();
} | [
"private",
"static",
"<",
"D",
"extends",
"DatastoreConfiguration",
"<",
"G",
">",
",",
"G",
"extends",
"GlobalContext",
"<",
"?",
",",
"?",
">",
">",
"AppendableConfigurationContext",
"invokeOptionConfigurator",
"(",
"OptionConfigurator",
"configurator",
")",
"{",
... | Invokes the given configurator, obtaining the correct global context type via the datastore configuration type of
the current datastore provider.
@param configurator the configurator to invoke
@return a context object containing the options set via the given configurator | [
"Invokes",
"the",
"given",
"configurator",
"obtaining",
"the",
"correct",
"global",
"context",
"type",
"via",
"the",
"datastore",
"configuration",
"type",
"of",
"the",
"current",
"datastore",
"provider",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/options/navigation/source/impl/OptionValueSources.java#L66-L72 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/impl/DefaultEntityKeyMetadata.java | DefaultEntityKeyMetadata.isKeyColumn | @Override
public boolean isKeyColumn(String columnName) {
for ( String keyColumName : getColumnNames() ) {
if ( keyColumName.equals( columnName ) ) {
return true;
}
}
return false;
} | java | @Override
public boolean isKeyColumn(String columnName) {
for ( String keyColumName : getColumnNames() ) {
if ( keyColumName.equals( columnName ) ) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"isKeyColumn",
"(",
"String",
"columnName",
")",
"{",
"for",
"(",
"String",
"keyColumName",
":",
"getColumnNames",
"(",
")",
")",
"{",
"if",
"(",
"keyColumName",
".",
"equals",
"(",
"columnName",
")",
")",
"{",
"return... | Whether the given column is part of this key family or not.
@return {@code true} if the given column is part of this key, {@code false} otherwise. | [
"Whether",
"the",
"given",
"column",
"is",
"part",
"of",
"this",
"key",
"family",
"or",
"not",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/impl/DefaultEntityKeyMetadata.java#L49-L58 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.loadEntitiesFromTuples | @Override
public List<Object> loadEntitiesFromTuples(SharedSessionContractImplementor session, LockOptions lockOptions, OgmLoadingContext ogmContext) {
return loadEntity( null, null, session, lockOptions, ogmContext );
} | java | @Override
public List<Object> loadEntitiesFromTuples(SharedSessionContractImplementor session, LockOptions lockOptions, OgmLoadingContext ogmContext) {
return loadEntity( null, null, session, lockOptions, ogmContext );
} | [
"@",
"Override",
"public",
"List",
"<",
"Object",
">",
"loadEntitiesFromTuples",
"(",
"SharedSessionContractImplementor",
"session",
",",
"LockOptions",
"lockOptions",
",",
"OgmLoadingContext",
"ogmContext",
")",
"{",
"return",
"loadEntity",
"(",
"null",
",",
"null",
... | Load a list of entities using the information in the context
@param session The session
@param lockOptions The locking details
@param ogmContext The context with the information to load the entities
@return the list of entities corresponding to the given context | [
"Load",
"a",
"list",
"of",
"entities",
"using",
"the",
"information",
"in",
"the",
"context"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L219-L222 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.loadCollection | public final void loadCollection(
final SharedSessionContractImplementor session,
final Serializable id,
final Type type) throws HibernateException {
if ( log.isDebugEnabled() ) {
log.debug(
"loading collection: " +
MessageHelper.collectionInfoString( getCollectionPersisters()[0], id, getFactory()... | java | public final void loadCollection(
final SharedSessionContractImplementor session,
final Serializable id,
final Type type) throws HibernateException {
if ( log.isDebugEnabled() ) {
log.debug(
"loading collection: " +
MessageHelper.collectionInfoString( getCollectionPersisters()[0], id, getFactory()... | [
"public",
"final",
"void",
"loadCollection",
"(",
"final",
"SharedSessionContractImplementor",
"session",
",",
"final",
"Serializable",
"id",
",",
"final",
"Type",
"type",
")",
"throws",
"HibernateException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",... | Called by subclasses that initialize collections
@param session the session
@param id the collection identifier
@param type collection type
@throws HibernateException if an error occurs | [
"Called",
"by",
"subclasses",
"that",
"initialize",
"collections"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L232-L255 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.doQueryAndInitializeNonLazyCollections | private List<Object> doQueryAndInitializeNonLazyCollections(
SharedSessionContractImplementor session,
QueryParameters qp,
OgmLoadingContext ogmLoadingContext,
boolean returnProxies) {
//TODO handles the read only
final PersistenceContext persistenceContext = session.getPersistenceContext();
boolean... | java | private List<Object> doQueryAndInitializeNonLazyCollections(
SharedSessionContractImplementor session,
QueryParameters qp,
OgmLoadingContext ogmLoadingContext,
boolean returnProxies) {
//TODO handles the read only
final PersistenceContext persistenceContext = session.getPersistenceContext();
boolean... | [
"private",
"List",
"<",
"Object",
">",
"doQueryAndInitializeNonLazyCollections",
"(",
"SharedSessionContractImplementor",
"session",
",",
"QueryParameters",
"qp",
",",
"OgmLoadingContext",
"ogmLoadingContext",
",",
"boolean",
"returnProxies",
")",
"{",
"//TODO handles the rea... | Load the entity activating the persistence context execution boundaries
@param session the session
@param qp the query parameters
@param ogmLoadingContext the loading context
@param returnProxies when {@code true}, get an existing proxy for each collection element (if there is one)
@return the result of the query | [
"Load",
"the",
"entity",
"activating",
"the",
"persistence",
"context",
"execution",
"boundaries"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L270-L303 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.doQuery | private List<Object> doQuery(
SharedSessionContractImplementor session,
QueryParameters qp,
OgmLoadingContext ogmLoadingContext,
boolean returnProxies) {
//TODO support lock timeout
int entitySpan = entityPersisters.length;
final List<Object> hydratedObjects = entitySpan == 0 ? null : new ArrayList<O... | java | private List<Object> doQuery(
SharedSessionContractImplementor session,
QueryParameters qp,
OgmLoadingContext ogmLoadingContext,
boolean returnProxies) {
//TODO support lock timeout
int entitySpan = entityPersisters.length;
final List<Object> hydratedObjects = entitySpan == 0 ? null : new ArrayList<O... | [
"private",
"List",
"<",
"Object",
">",
"doQuery",
"(",
"SharedSessionContractImplementor",
"session",
",",
"QueryParameters",
"qp",
",",
"OgmLoadingContext",
"ogmLoadingContext",
",",
"boolean",
"returnProxies",
")",
"{",
"//TODO support lock timeout",
"int",
"entitySpan"... | Execute the physical query and initialize the various entities and collections
@param session the session
@param qp the query parameters
@param ogmLoadingContext the loading context
@param returnProxies when {@code true}, get an existing proxy for each collection element (if there is one)
@return the result of the que... | [
"Execute",
"the",
"physical",
"query",
"and",
"initialize",
"the",
"various",
"entities",
"and",
"collections"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L314-L397 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.readCollectionElement | private void readCollectionElement(
final Object optionalOwner,
final Serializable optionalKey,
final CollectionPersister persister,
final CollectionAliases descriptor,
final ResultSet rs,
final SharedSessionContractImplementor session)
throws HibernateException, SQLException {
final PersistenceConte... | java | private void readCollectionElement(
final Object optionalOwner,
final Serializable optionalKey,
final CollectionPersister persister,
final CollectionAliases descriptor,
final ResultSet rs,
final SharedSessionContractImplementor session)
throws HibernateException, SQLException {
final PersistenceConte... | [
"private",
"void",
"readCollectionElement",
"(",
"final",
"Object",
"optionalOwner",
",",
"final",
"Serializable",
"optionalKey",
",",
"final",
"CollectionPersister",
"persister",
",",
"final",
"CollectionAliases",
"descriptor",
",",
"final",
"ResultSet",
"rs",
",",
"... | Read one collection element from the current row of the JDBC result set
@param optionalOwner the collection owner
@param optionalKey the collection key
@param persister the collection persister
@param descriptor the collection aliases
@param rs the result set
@param session the session
@throws HibernateException if an... | [
"Read",
"one",
"collection",
"element",
"from",
"the",
"current",
"row",
"of",
"the",
"JDBC",
"result",
"set"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L686-L755 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.instanceAlreadyLoaded | private void instanceAlreadyLoaded(
final Tuple resultset,
final int i,
//TODO create an interface for this usage
final OgmEntityPersister persister,
final org.hibernate.engine.spi.EntityKey key,
final Object object,
final LockMode lockMode,
final SharedSessionContractImplementor session)
throws Hiber... | java | private void instanceAlreadyLoaded(
final Tuple resultset,
final int i,
//TODO create an interface for this usage
final OgmEntityPersister persister,
final org.hibernate.engine.spi.EntityKey key,
final Object object,
final LockMode lockMode,
final SharedSessionContractImplementor session)
throws Hiber... | [
"private",
"void",
"instanceAlreadyLoaded",
"(",
"final",
"Tuple",
"resultset",
",",
"final",
"int",
"i",
",",
"//TODO create an interface for this usage",
"final",
"OgmEntityPersister",
"persister",
",",
"final",
"org",
".",
"hibernate",
".",
"engine",
".",
"spi",
... | The entity instance is already in the session cache
Copied from Loader#instanceAlreadyLoaded | [
"The",
"entity",
"instance",
"is",
"already",
"in",
"the",
"session",
"cache"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L985-L1020 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.instanceNotYetLoaded | private Object instanceNotYetLoaded(
final Tuple resultset,
final int i,
final Loadable persister,
final String rowIdAlias,
final org.hibernate.engine.spi.EntityKey key,
final LockMode lockMode,
final org.hibernate.engine.spi.EntityKey optionalObjectKey,
final Object optionalObject,
final List hydrate... | java | private Object instanceNotYetLoaded(
final Tuple resultset,
final int i,
final Loadable persister,
final String rowIdAlias,
final org.hibernate.engine.spi.EntityKey key,
final LockMode lockMode,
final org.hibernate.engine.spi.EntityKey optionalObjectKey,
final Object optionalObject,
final List hydrate... | [
"private",
"Object",
"instanceNotYetLoaded",
"(",
"final",
"Tuple",
"resultset",
",",
"final",
"int",
"i",
",",
"final",
"Loadable",
"persister",
",",
"final",
"String",
"rowIdAlias",
",",
"final",
"org",
".",
"hibernate",
".",
"engine",
".",
"spi",
".",
"En... | The entity instance is not in the session cache
Copied from Loader#instanceNotYetLoaded | [
"The",
"entity",
"instance",
"is",
"not",
"in",
"the",
"session",
"cache"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L1027-L1079 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java | OgmLoader.registerNonExists | private void registerNonExists(
final org.hibernate.engine.spi.EntityKey[] keys,
final Loadable[] persisters,
final SharedSessionContractImplementor session) {
final int[] owners = getOwners();
if ( owners != null ) {
EntityType[] ownerAssociationTypes = getOwnerAssociationTypes();
for ( int i = 0; i ... | java | private void registerNonExists(
final org.hibernate.engine.spi.EntityKey[] keys,
final Loadable[] persisters,
final SharedSessionContractImplementor session) {
final int[] owners = getOwners();
if ( owners != null ) {
EntityType[] ownerAssociationTypes = getOwnerAssociationTypes();
for ( int i = 0; i ... | [
"private",
"void",
"registerNonExists",
"(",
"final",
"org",
".",
"hibernate",
".",
"engine",
".",
"spi",
".",
"EntityKey",
"[",
"]",
"keys",
",",
"final",
"Loadable",
"[",
"]",
"persisters",
",",
"final",
"SharedSessionContractImplementor",
"session",
")",
"{... | For missing objects associated by one-to-one with another object in the
result set, register the fact that the object is missing with the
session.
copied form Loader#registerNonExists | [
"For",
"missing",
"objects",
"associated",
"by",
"one",
"-",
"to",
"-",
"one",
"with",
"another",
"object",
"in",
"the",
"result",
"set",
"register",
"the",
"fact",
"that",
"the",
"object",
"is",
"missing",
"with",
"the",
"session",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/impl/OgmLoader.java#L1222-L1279 | train |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/query/parsing/nativequery/impl/NativeQueryParser.java | NativeQueryParser.CriteriaOnlyFindQuery | public Rule CriteriaOnlyFindQuery() {
return Sequence( !peek().isCliQuery(), JsonParameter( JsonObject() ) , peek().setOperation( Operation.FIND ), peek().setCriteria( match() ) );
} | java | public Rule CriteriaOnlyFindQuery() {
return Sequence( !peek().isCliQuery(), JsonParameter( JsonObject() ) , peek().setOperation( Operation.FIND ), peek().setCriteria( match() ) );
} | [
"public",
"Rule",
"CriteriaOnlyFindQuery",
"(",
")",
"{",
"return",
"Sequence",
"(",
"!",
"peek",
"(",
")",
".",
"isCliQuery",
"(",
")",
",",
"JsonParameter",
"(",
"JsonObject",
"(",
")",
")",
",",
"peek",
"(",
")",
".",
"setOperation",
"(",
"Operation",... | A find query only given as criterion. Leave it to MongoDB's own parser to handle it.
@return the {@link Rule} to identify a find query only | [
"A",
"find",
"query",
"only",
"given",
"as",
"criterion",
".",
"Leave",
"it",
"to",
"MongoDB",
"s",
"own",
"parser",
"to",
"handle",
"it",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/query/parsing/nativequery/impl/NativeQueryParser.java#L79-L81 | train |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/util/impl/ReflectionHelper.java | ReflectionHelper.introspect | public static Map<String, Object> introspect(Object obj) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
Map<String, Object> result = new HashMap<>();
BeanInfo info = Introspector.getBeanInfo( obj.getClass() );
for ( PropertyDescriptor pd : info.getPropertyDescriptors() ) {
M... | java | public static Map<String, Object> introspect(Object obj) throws IntrospectionException, InvocationTargetException, IllegalAccessException {
Map<String, Object> result = new HashMap<>();
BeanInfo info = Introspector.getBeanInfo( obj.getClass() );
for ( PropertyDescriptor pd : info.getPropertyDescriptors() ) {
M... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"introspect",
"(",
"Object",
"obj",
")",
"throws",
"IntrospectionException",
",",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
"... | Introspect the given object.
@param obj object for introspection.
@return a map containing object's field values.
@throws IntrospectionException if an exception occurs during introspection
@throws InvocationTargetException if property getter throws an exception
@throws IllegalAccessException if property getter is in... | [
"Introspect",
"the",
"given",
"object",
"."
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/util/impl/ReflectionHelper.java#L43-L54 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.