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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
hal/core | gui/src/main/java/org/jboss/as/console/client/widgets/pages/Pages.java | Pages.add | public void add(Widget w, String tabText, boolean asHTML) {
insert(w, tabText, asHTML, getWidgetCount());
} | java | public void add(Widget w, String tabText, boolean asHTML) {
insert(w, tabText, asHTML, getWidgetCount());
} | [
"public",
"void",
"add",
"(",
"Widget",
"w",
",",
"String",
"tabText",
",",
"boolean",
"asHTML",
")",
"{",
"insert",
"(",
"w",
",",
"tabText",
",",
"asHTML",
",",
"getWidgetCount",
"(",
")",
")",
";",
"}"
] | Adds a widget to the tab panel. If the Widget is already attached to the
TabPanel, it will be moved to the right-most index.
@param w the widget to be added
@param tabText the text to be shown on its tab
@param asHTML <code>true</code> to treat the specified text as HTML | [
"Adds",
"a",
"widget",
"to",
"the",
"tab",
"panel",
".",
"If",
"the",
"Widget",
"is",
"already",
"attached",
"to",
"the",
"TabPanel",
"it",
"will",
"be",
"moved",
"to",
"the",
"right",
"-",
"most",
"index",
"."
] | d6d03f0bb128dc0470f5dc75fdb1ea1014400602 | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/pages/Pages.java#L194-L196 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPIPN.java | MPIPN.manage | public static <T extends MPBase> T manage(Topic topic, String id) throws MPException {
if (topic == null ||
id == null) {
throw new MPException("Topic and Id can not be null in the IPN request");
}
T resourceObject = null;
Class clazz = null;
Method m... | java | public static <T extends MPBase> T manage(Topic topic, String id) throws MPException {
if (topic == null ||
id == null) {
throw new MPException("Topic and Id can not be null in the IPN request");
}
T resourceObject = null;
Class clazz = null;
Method m... | [
"public",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"manage",
"(",
"Topic",
"topic",
",",
"String",
"id",
")",
"throws",
"MPException",
"{",
"if",
"(",
"topic",
"==",
"null",
"||",
"id",
"==",
"null",
")",
"{",
"throw",
"new",
"MPException",
... | It manages an IPN and returns a resource
@param topic Type of IPN
@param id String with the id of the resource
@param <T>
@return
@throws MPException | [
"It",
"manages",
"an",
"IPN",
"and",
"returns",
"a",
"resource"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPIPN.java#L39-L60 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPResourceArray.java | MPResourceArray.getByIndex | public <T extends MPBase> T getByIndex(int index) {
T resource = (T) _resourceArray.get(index);
return resource;
} | java | public <T extends MPBase> T getByIndex(int index) {
T resource = (T) _resourceArray.get(index);
return resource;
} | [
"public",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"getByIndex",
"(",
"int",
"index",
")",
"{",
"T",
"resource",
"=",
"(",
"T",
")",
"_resourceArray",
".",
"get",
"(",
"index",
")",
";",
"return",
"resource",
";",
"}"
] | It returns one resource using its index in the array
@param index an int with the index
@param <T>
@return | [
"It",
"returns",
"one",
"resource",
"using",
"its",
"index",
"in",
"the",
"array"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPResourceArray.java#L44-L47 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPResourceArray.java | MPResourceArray.getById | public <T extends MPBase> T getById(String id) throws MPException {
T resource = null;
for (int i = 0; i < _resourceArray.size(); i++) {
resource = getByIndex(i);
try {
Field field = resource.getClass().getDeclaredField("id");
field.setAccessible(t... | java | public <T extends MPBase> T getById(String id) throws MPException {
T resource = null;
for (int i = 0; i < _resourceArray.size(); i++) {
resource = getByIndex(i);
try {
Field field = resource.getClass().getDeclaredField("id");
field.setAccessible(t... | [
"public",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"getById",
"(",
"String",
"id",
")",
"throws",
"MPException",
"{",
"T",
"resource",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_resourceArray",
".",
"size",
"(",
")",
";",
... | It returns one resource of the array using the id
@param id a String with the id of the resource to be returned
@param <T>
@return
@throws MPException | [
"It",
"returns",
"one",
"resource",
"of",
"the",
"array",
"using",
"the",
"id"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPResourceArray.java#L57-L73 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.processMethod | protected <T extends MPBase> T processMethod(String methodName, Boolean useCache) throws MPException {
HashMap<String, String> mapParams = null;
T resource = processMethod(this.getClass(), (T)this, methodName, mapParams, useCache);
fillResource(resource, this);
return (T)this;
} | java | protected <T extends MPBase> T processMethod(String methodName, Boolean useCache) throws MPException {
HashMap<String, String> mapParams = null;
T resource = processMethod(this.getClass(), (T)this, methodName, mapParams, useCache);
fillResource(resource, this);
return (T)this;
} | [
"protected",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"processMethod",
"(",
"String",
"methodName",
",",
"Boolean",
"useCache",
")",
"throws",
"MPException",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"mapParams",
"=",
"null",
";",
"T",
"resource",
... | Process the method to call the api, usually used for create, update and delete methods
@param methodName a String with the decorated method to be processed
@param useCache a Boolean flag that indicates if the cache must be used
@return a resourse obj fill with the api response
@throws ... | [
"Process",
"the",
"method",
"to",
"call",
"the",
"api",
"usually",
"used",
"for",
"create",
"update",
"and",
"delete",
"methods"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L90-L95 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.processMethod | protected static <T extends MPBase> T processMethod(Class clazz, String methodName, String param1, Boolean useCache) throws MPException {
HashMap<String, String> mapParams = new HashMap<String, String>();
mapParams.put("param1", param1);
return processMethod(clazz, null, methodName, mapParams, ... | java | protected static <T extends MPBase> T processMethod(Class clazz, String methodName, String param1, Boolean useCache) throws MPException {
HashMap<String, String> mapParams = new HashMap<String, String>();
mapParams.put("param1", param1);
return processMethod(clazz, null, methodName, mapParams, ... | [
"protected",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"processMethod",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
",",
"String",
"param1",
",",
"Boolean",
"useCache",
")",
"throws",
"MPException",
"{",
"HashMap",
"<",
"String",
",",
"Strin... | Process the method to call the api, usually used for load methods
@param clazz a MPBase extended class
@param methodName a String with the decorated method to be processed
@param param1 a String with the arg passed in the call of the method
@param useCache a Boolean flag that ind... | [
"Process",
"the",
"method",
"to",
"call",
"the",
"api",
"usually",
"used",
"for",
"load",
"methods"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L107-L112 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.callApi | private static MPApiResponse callApi(
HttpMethod httpMethod,
String path,
PayloadType payloadType,
JsonObject payload,
Collection<Header> colHeaders,
int retries,
int connectionTimeout,
int socketTimeout,
Boolean... | java | private static MPApiResponse callApi(
HttpMethod httpMethod,
String path,
PayloadType payloadType,
JsonObject payload,
Collection<Header> colHeaders,
int retries,
int connectionTimeout,
int socketTimeout,
Boolean... | [
"private",
"static",
"MPApiResponse",
"callApi",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"path",
",",
"PayloadType",
"payloadType",
",",
"JsonObject",
"payload",
",",
"Collection",
"<",
"Header",
">",
"colHeaders",
",",
"int",
"retries",
",",
"int",
"con... | Calls the api and returns an MPApiResponse.
@param httpMethod the http method to be processed
@param path a String with the full url of the endpoint
@param payloadType a PayloadType obj
@param payload a JsonObject with the content of t... | [
"Calls",
"the",
"api",
"and",
"returns",
"an",
"MPApiResponse",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L304-L340 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.fillResourceWithResponseData | protected static <T extends MPBase> T fillResourceWithResponseData(T resource, MPApiResponse response) throws MPException {
if (response.getJsonElementResponse() != null &&
response.getJsonElementResponse().isJsonObject()) {
JsonObject jsonObject = (JsonObject) response.getJsonElemen... | java | protected static <T extends MPBase> T fillResourceWithResponseData(T resource, MPApiResponse response) throws MPException {
if (response.getJsonElementResponse() != null &&
response.getJsonElementResponse().isJsonObject()) {
JsonObject jsonObject = (JsonObject) response.getJsonElemen... | [
"protected",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"fillResourceWithResponseData",
"(",
"T",
"resource",
",",
"MPApiResponse",
"response",
")",
"throws",
"MPException",
"{",
"if",
"(",
"response",
".",
"getJsonElementResponse",
"(",
")",
"!=",
"null... | It fills all the attributes members of the Resource obj.
Used when a Get or a Put request is called
@param response Response of the request
@throws MPException | [
"It",
"fills",
"all",
"the",
"attributes",
"members",
"of",
"the",
"Resource",
"obj",
".",
"Used",
"when",
"a",
"Get",
"or",
"a",
"Put",
"request",
"is",
"called"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L349-L358 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.fillArrayWithResponseData | protected static <T extends MPBase> ArrayList<T> fillArrayWithResponseData(Class clazz, MPApiResponse response) throws MPException {
ArrayList<T> resourceArray = new ArrayList<T>();
if (response.getJsonElementResponse() != null) {
JsonArray jsonArray = MPCoreUtils.getArrayFromJsonElement(res... | java | protected static <T extends MPBase> ArrayList<T> fillArrayWithResponseData(Class clazz, MPApiResponse response) throws MPException {
ArrayList<T> resourceArray = new ArrayList<T>();
if (response.getJsonElementResponse() != null) {
JsonArray jsonArray = MPCoreUtils.getArrayFromJsonElement(res... | [
"protected",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"ArrayList",
"<",
"T",
">",
"fillArrayWithResponseData",
"(",
"Class",
"clazz",
",",
"MPApiResponse",
"response",
")",
"throws",
"MPException",
"{",
"ArrayList",
"<",
"T",
">",
"resourceArray",
"=",
"n... | It fills an array with the resource objects from the api response
@param clazz a MPBase extended class
@param response MPApiResponse obj.
@param <T>
@return
@throws MPException | [
"It",
"fills",
"an",
"array",
"with",
"the",
"resource",
"objects",
"from",
"the",
"api",
"response"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L369-L382 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.fillResource | private static <T extends MPBase> T fillResource(T sourceResource, T destinationResource) throws MPException {
Field[] declaredFields = destinationResource.getClass().getDeclaredFields();
for (Field field : declaredFields) {
try {
Field originField = sourceResource.getClass()... | java | private static <T extends MPBase> T fillResource(T sourceResource, T destinationResource) throws MPException {
Field[] declaredFields = destinationResource.getClass().getDeclaredFields();
for (Field field : declaredFields) {
try {
Field originField = sourceResource.getClass()... | [
"private",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"fillResource",
"(",
"T",
"sourceResource",
",",
"T",
"destinationResource",
")",
"throws",
"MPException",
"{",
"Field",
"[",
"]",
"declaredFields",
"=",
"destinationResource",
".",
"getClass",
"(",
... | Copies the atributes from an obj to a destination obj
@param sourceResource source resource obj
@param destinationResource destination resource obj
@param <T>
@return
@throws MPException | [
"Copies",
"the",
"atributes",
"from",
"an",
"obj",
"to",
"a",
"destination",
"obj"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L393-L407 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.cleanResource | private static <T extends MPBase> T cleanResource(T resource) throws MPException {
Field[] declaredFields = resource.getClass().getDeclaredFields();
for (Field field : declaredFields) {
try {
field.setAccessible(true);
field.set(resource, null);
... | java | private static <T extends MPBase> T cleanResource(T resource) throws MPException {
Field[] declaredFields = resource.getClass().getDeclaredFields();
for (Field field : declaredFields) {
try {
field.setAccessible(true);
field.set(resource, null);
... | [
"private",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"cleanResource",
"(",
"T",
"resource",
")",
"throws",
"MPException",
"{",
"Field",
"[",
"]",
"declaredFields",
"=",
"resource",
".",
"getClass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
";"... | Removes all data from the attributes members of the Resource obj.
Used when a delete request is called
@throws MPException | [
"Removes",
"all",
"data",
"from",
"the",
"attributes",
"members",
"of",
"the",
"Resource",
"obj",
".",
"Used",
"when",
"a",
"delete",
"request",
"is",
"called"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L415-L428 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.getStandardHeaders | private static Collection<Header> getStandardHeaders() {
Collection<Header> colHeaders = new Vector<Header>();
colHeaders.add(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
colHeaders.add(new BasicHeader(HTTP.USER_AGENT, "MercadoPago Java SDK/1.0.10"));
colHeaders.add(new Basic... | java | private static Collection<Header> getStandardHeaders() {
Collection<Header> colHeaders = new Vector<Header>();
colHeaders.add(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
colHeaders.add(new BasicHeader(HTTP.USER_AGENT, "MercadoPago Java SDK/1.0.10"));
colHeaders.add(new Basic... | [
"private",
"static",
"Collection",
"<",
"Header",
">",
"getStandardHeaders",
"(",
")",
"{",
"Collection",
"<",
"Header",
">",
"colHeaders",
"=",
"new",
"Vector",
"<",
"Header",
">",
"(",
")",
";",
"colHeaders",
".",
"add",
"(",
"new",
"BasicHeader",
"(",
... | Returns standard headers for all the requests
@return a collection with headers objects | [
"Returns",
"standard",
"headers",
"for",
"all",
"the",
"requests"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L435-L441 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.generatePayload | private static <T extends MPBase> JsonObject generatePayload(HttpMethod httpMethod, T resource) {
JsonObject payload = null;
if (httpMethod.equals(HttpMethod.POST) ||
(httpMethod.equals(HttpMethod.PUT) && resource._lastKnownJson == null)) {
payload = MPCoreUtils.getJsonFromRe... | java | private static <T extends MPBase> JsonObject generatePayload(HttpMethod httpMethod, T resource) {
JsonObject payload = null;
if (httpMethod.equals(HttpMethod.POST) ||
(httpMethod.equals(HttpMethod.PUT) && resource._lastKnownJson == null)) {
payload = MPCoreUtils.getJsonFromRe... | [
"private",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"JsonObject",
"generatePayload",
"(",
"HttpMethod",
"httpMethod",
",",
"T",
"resource",
")",
"{",
"JsonObject",
"payload",
"=",
"null",
";",
"if",
"(",
"httpMethod",
".",
"equals",
"(",
"HttpMethod",
"... | Transforms all attributes members of the instance in a JSON String. Only for POST and PUT methods.
POST gets the full object in a JSON object.
PUT gets only the differences with the last known state of the object.
@return a JSON Object with the attributes members of the instance. Null for GET and DELE... | [
"Transforms",
"all",
"attributes",
"members",
"of",
"the",
"instance",
"in",
"a",
"JSON",
"String",
".",
"Only",
"for",
"POST",
"and",
"PUT",
"methods",
".",
"POST",
"gets",
"the",
"full",
"object",
"in",
"a",
"JSON",
"object",
".",
"PUT",
"gets",
"only"... | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L548-L595 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.getRestInformation | private static HashMap<String, Object> getRestInformation(AnnotatedElement element) throws MPException{
if (element.getAnnotations().length == 0) {
throw new MPException("No rest method found");
}
HashMap<String, Object> hashAnnotation = new HashMap<String, Object>();
for (A... | java | private static HashMap<String, Object> getRestInformation(AnnotatedElement element) throws MPException{
if (element.getAnnotations().length == 0) {
throw new MPException("No rest method found");
}
HashMap<String, Object> hashAnnotation = new HashMap<String, Object>();
for (A... | [
"private",
"static",
"HashMap",
"<",
"String",
",",
"Object",
">",
"getRestInformation",
"(",
"AnnotatedElement",
"element",
")",
"throws",
"MPException",
"{",
"if",
"(",
"element",
".",
"getAnnotations",
"(",
")",
".",
"length",
"==",
"0",
")",
"{",
"throw"... | Iterates the annotations of the entity method implementation, it validates that only one method annotation
is used in the entity implementation method.
@param element The annotated method of the entity
@return a hashmap with keys 'method' and 'path'
@throws MPException | [
"Iterates",
"the",
"annotations",
"of",
"the",
"entity",
"method",
"implementation",
"it",
"validates",
"that",
"only",
"one",
"method",
"annotation",
"is",
"used",
"in",
"the",
"entity",
"implementation",
"method",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L605-L670 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.getAnnotatedMethod | private static AnnotatedElement getAnnotatedMethod(Class clazz, String methodName) throws MPException {
for (Method method : clazz.getDeclaredMethods()) {
if (method.getName().equals(methodName) &&
method.getDeclaredAnnotations().length > 0) {
return method;
... | java | private static AnnotatedElement getAnnotatedMethod(Class clazz, String methodName) throws MPException {
for (Method method : clazz.getDeclaredMethods()) {
if (method.getName().equals(methodName) &&
method.getDeclaredAnnotations().length > 0) {
return method;
... | [
"private",
"static",
"AnnotatedElement",
"getAnnotatedMethod",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
")",
"throws",
"MPException",
"{",
"for",
"(",
"Method",
"method",
":",
"clazz",
".",
"getDeclaredMethods",
"(",
")",
")",
"{",
"if",
"(",
"metho... | Iterates over the methods of a class and returns the one matching the method name passed
@param methodName a String with the name of the method to be recuperated
@return a AnnotatedMethod that match the method name passed
@throws MPException | [
"Iterates",
"over",
"the",
"methods",
"of",
"a",
"class",
"and",
"returns",
"the",
"one",
"matching",
"the",
"method",
"name",
"passed"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L713-L721 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCredentials.java | MPCredentials.getAccessToken | public static String getAccessToken() throws MPException {
if (StringUtils.isEmpty(MercadoPago.SDK.getClientId()) ||
StringUtils.isEmpty(MercadoPago.SDK.getClientSecret())) {
throw new MPException("\"client_id\" and \"client_secret\" can not be \"null\" when getting the \"access_toke... | java | public static String getAccessToken() throws MPException {
if (StringUtils.isEmpty(MercadoPago.SDK.getClientId()) ||
StringUtils.isEmpty(MercadoPago.SDK.getClientSecret())) {
throw new MPException("\"client_id\" and \"client_secret\" can not be \"null\" when getting the \"access_toke... | [
"public",
"static",
"String",
"getAccessToken",
"(",
")",
"throws",
"MPException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"MercadoPago",
".",
"SDK",
".",
"getClientId",
"(",
")",
")",
"||",
"StringUtils",
".",
"isEmpty",
"(",
"MercadoPago",
".",... | Call the oauth api to get an access token
@return a String with the access token
@throws MPException | [
"Call",
"the",
"oauth",
"api",
"to",
"get",
"an",
"access",
"token"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCredentials.java#L26-L56 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPApiResponse.java | MPApiResponse.parseRequest | private void parseRequest(HttpMethod httpMethod, HttpRequestBase request, JsonObject payload) throws MPException {
this.method = httpMethod.toString();
this.url = request.getURI().toString();
if (payload != null) {
this.payload = payload.toString();
}
} | java | private void parseRequest(HttpMethod httpMethod, HttpRequestBase request, JsonObject payload) throws MPException {
this.method = httpMethod.toString();
this.url = request.getURI().toString();
if (payload != null) {
this.payload = payload.toString();
}
} | [
"private",
"void",
"parseRequest",
"(",
"HttpMethod",
"httpMethod",
",",
"HttpRequestBase",
"request",
",",
"JsonObject",
"payload",
")",
"throws",
"MPException",
"{",
"this",
".",
"method",
"=",
"httpMethod",
".",
"toString",
"(",
")",
";",
"this",
".",
"url"... | Parses the http request in a custom MPApiResponse object.
@param httpMethod enum with the method executed
@param request HttpRequestBase object
@param payload JsonObject with the payload
@throws MPException | [
"Parses",
"the",
"http",
"request",
"in",
"a",
"custom",
"MPApiResponse",
"object",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPApiResponse.java#L90-L96 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPApiResponse.java | MPApiResponse.parseResponse | private void parseResponse(HttpResponse response) throws MPException {
this.statusCode = response.getStatusLine().getStatusCode();
this.reasonPhrase = response.getStatusLine().getReasonPhrase();
if (response.getEntity() != null) {
HttpEntity respEntity = response.getEntity();
... | java | private void parseResponse(HttpResponse response) throws MPException {
this.statusCode = response.getStatusLine().getStatusCode();
this.reasonPhrase = response.getStatusLine().getReasonPhrase();
if (response.getEntity() != null) {
HttpEntity respEntity = response.getEntity();
... | [
"private",
"void",
"parseResponse",
"(",
"HttpResponse",
"response",
")",
"throws",
"MPException",
"{",
"this",
".",
"statusCode",
"=",
"response",
".",
"getStatusLine",
"(",
")",
".",
"getStatusCode",
"(",
")",
";",
"this",
".",
"reasonPhrase",
"=",
"response... | Parses the http response in a custom MPApiResponse object.
@param response a Http response to be parsed
@throws MPException | [
"Parses",
"the",
"http",
"response",
"in",
"a",
"custom",
"MPApiResponse",
"object",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPApiResponse.java#L104-L125 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPValidator.java | MPValidator.validate | public static <T extends MPBase> boolean validate(T objectToValidate) throws MPValidationException {
Collection<ValidationViolation> colViolations = validate(new Vector<ValidationViolation>(), objectToValidate);
if (!colViolations.isEmpty()) {
throw new MPValidationException(colViolations);
... | java | public static <T extends MPBase> boolean validate(T objectToValidate) throws MPValidationException {
Collection<ValidationViolation> colViolations = validate(new Vector<ValidationViolation>(), objectToValidate);
if (!colViolations.isEmpty()) {
throw new MPValidationException(colViolations);
... | [
"public",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"boolean",
"validate",
"(",
"T",
"objectToValidate",
")",
"throws",
"MPValidationException",
"{",
"Collection",
"<",
"ValidationViolation",
">",
"colViolations",
"=",
"validate",
"(",
"new",
"Vector",
"<",
... | Evaluates every field of an obj using Validation annotations
@param objectToValidate Object to be evaluated
@param <T>
@return
@throws MPValidationException | [
"Evaluates",
"every",
"field",
"of",
"an",
"obj",
"using",
"Validation",
"annotations"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPValidator.java#L31-L37 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.getAllFields | static Field[] getAllFields(Class<?> type) {
List<Field> fields = new ArrayList<Field>();
for (Class<?> clazz = type; clazz != null; clazz = clazz.getSuperclass()) {
if (clazz == MPBase.class ||
clazz == Object.class) {
break;
}
fie... | java | static Field[] getAllFields(Class<?> type) {
List<Field> fields = new ArrayList<Field>();
for (Class<?> clazz = type; clazz != null; clazz = clazz.getSuperclass()) {
if (clazz == MPBase.class ||
clazz == Object.class) {
break;
}
fie... | [
"static",
"Field",
"[",
"]",
"getAllFields",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"List",
"<",
"Field",
">",
"fields",
"=",
"new",
"ArrayList",
"<",
"Field",
">",
"(",
")",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"clazz",
"=",
"type",
... | Retrieves all fields from a class except the ones from MPBase abstract class and Object class
@param type Java Class type
@return | [
"Retrieves",
"all",
"fields",
"from",
"a",
"class",
"except",
"the",
"ones",
"from",
"MPBase",
"abstract",
"class",
"and",
"Object",
"class"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L40-L51 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.getJsonFromResource | public static <T extends MPBase> JsonObject getJsonFromResource(T resourceObject) {
return (JsonObject) gson.toJsonTree(resourceObject);
} | java | public static <T extends MPBase> JsonObject getJsonFromResource(T resourceObject) {
return (JsonObject) gson.toJsonTree(resourceObject);
} | [
"public",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"JsonObject",
"getJsonFromResource",
"(",
"T",
"resourceObject",
")",
"{",
"return",
"(",
"JsonObject",
")",
"gson",
".",
"toJsonTree",
"(",
"resourceObject",
")",
";",
"}"
] | Static method that transforms all attributes members of the instance in a JSON Object.
@return a JSON Object with the attributes members of the instance | [
"Static",
"method",
"that",
"transforms",
"all",
"attributes",
"members",
"of",
"the",
"instance",
"in",
"a",
"JSON",
"Object",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L58-L60 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.getResourceFromJson | public static <T> T getResourceFromJson(Class clazz, JsonObject jsonEntity) {
return (T) gson.fromJson(jsonEntity, clazz);
} | java | public static <T> T getResourceFromJson(Class clazz, JsonObject jsonEntity) {
return (T) gson.fromJson(jsonEntity, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getResourceFromJson",
"(",
"Class",
"clazz",
",",
"JsonObject",
"jsonEntity",
")",
"{",
"return",
"(",
"T",
")",
"gson",
".",
"fromJson",
"(",
"jsonEntity",
",",
"clazz",
")",
";",
"}"
] | Static method that transforms a Json Object in a MP Resource.
@param clazz Java Class type of the resource
@param jsonEntity JsonObject to be transformed
@param <T>
@return | [
"Static",
"method",
"that",
"transforms",
"a",
"Json",
"Object",
"in",
"a",
"MP",
"Resource",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L70-L72 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.inputStreamToString | public static String inputStreamToString(InputStream is) throws MPException {
String value = "";
if (is != null) {
try {
ByteArrayOutputStream result = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
whi... | java | public static String inputStreamToString(InputStream is) throws MPException {
String value = "";
if (is != null) {
try {
ByteArrayOutputStream result = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
whi... | [
"public",
"static",
"String",
"inputStreamToString",
"(",
"InputStream",
"is",
")",
"throws",
"MPException",
"{",
"String",
"value",
"=",
"\"\"",
";",
"if",
"(",
"is",
"!=",
"null",
")",
"{",
"try",
"{",
"ByteArrayOutputStream",
"result",
"=",
"new",
"ByteAr... | Static method that transform an Input Stream to a String object, returns an empty string if InputStream is null.
@param is Input Stream to process
@return a String with the stream content
@throws MPException | [
"Static",
"method",
"that",
"transform",
"an",
"Input",
"Stream",
"to",
"a",
"String",
"object",
"returns",
"an",
"empty",
"string",
"if",
"InputStream",
"is",
"null",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L81-L99 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.validateUrl | public static boolean validateUrl(String url) {
String[] schemes = {"https"};
UrlValidator urlValidator = new UrlValidator(schemes);
return urlValidator.isValid(url);
} | java | public static boolean validateUrl(String url) {
String[] schemes = {"https"};
UrlValidator urlValidator = new UrlValidator(schemes);
return urlValidator.isValid(url);
} | [
"public",
"static",
"boolean",
"validateUrl",
"(",
"String",
"url",
")",
"{",
"String",
"[",
"]",
"schemes",
"=",
"{",
"\"https\"",
"}",
";",
"UrlValidator",
"urlValidator",
"=",
"new",
"UrlValidator",
"(",
"schemes",
")",
";",
"return",
"urlValidator",
".",... | Validates if an url is a valid url address
@param url url address to validate
@return | [
"Validates",
"if",
"an",
"url",
"is",
"a",
"valid",
"url",
"address"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L107-L111 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.getArrayFromJsonElement | static JsonArray getArrayFromJsonElement(JsonElement jsonElement) {
JsonArray jsonArray = null;
if (jsonElement.isJsonArray()) {
jsonArray = jsonElement.getAsJsonArray();
} else if (jsonElement.isJsonObject() &&
((JsonObject) jsonElement).get("results") != null &&
... | java | static JsonArray getArrayFromJsonElement(JsonElement jsonElement) {
JsonArray jsonArray = null;
if (jsonElement.isJsonArray()) {
jsonArray = jsonElement.getAsJsonArray();
} else if (jsonElement.isJsonObject() &&
((JsonObject) jsonElement).get("results") != null &&
... | [
"static",
"JsonArray",
"getArrayFromJsonElement",
"(",
"JsonElement",
"jsonElement",
")",
"{",
"JsonArray",
"jsonArray",
"=",
"null",
";",
"if",
"(",
"jsonElement",
".",
"isJsonArray",
"(",
")",
")",
"{",
"jsonArray",
"=",
"jsonElement",
".",
"getAsJsonArray",
"... | Analizes a JsonElement and determines if its a result of a api search or loadAll method
@param jsonElement the jsonElement to be analized
@return | [
"Analizes",
"a",
"JsonElement",
"and",
"determines",
"if",
"its",
"a",
"result",
"of",
"a",
"api",
"search",
"or",
"loadAll",
"method"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L119-L129 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/net/MPRestClient.java | MPRestClient.executeRequest | public MPApiResponse executeRequest(HttpMethod httpMethod, String uri, PayloadType payloadType, JsonObject payload, Collection<Header> colHeaders, int retries, int connectionTimeout, int socketTimeout)
throws MPRestException {
HttpClient httpClient = null;
try {
httpClient = getC... | java | public MPApiResponse executeRequest(HttpMethod httpMethod, String uri, PayloadType payloadType, JsonObject payload, Collection<Header> colHeaders, int retries, int connectionTimeout, int socketTimeout)
throws MPRestException {
HttpClient httpClient = null;
try {
httpClient = getC... | [
"public",
"MPApiResponse",
"executeRequest",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"uri",
",",
"PayloadType",
"payloadType",
",",
"JsonObject",
"payload",
",",
"Collection",
"<",
"Header",
">",
"colHeaders",
",",
"int",
"retries",
",",
"int",
"connection... | Executes a http request and returns a response
@param httpMethod a String with the http method to execute
@param uri a String with the uri
@param payloadType PayloadType NONE, JSON, FORM_DATA, X_WWW_FORM_URLENCODED
@param payload JsonObject with the ... | [
"Executes",
"a",
"http",
"request",
"and",
"returns",
"a",
"response"
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/net/MPRestClient.java#L90-L135 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/net/MPRestClient.java | MPRestClient.getClient | private HttpClient getClient(int retries, int connectionTimeout, int socketTimeout) {
HttpClient httpClient = new DefaultHttpClient();
HttpParams httpParams = httpClient.getParams();
// Retries
if (retries > 0) {
DefaultHttpRequestRetryHandler retryHandler = new DefaultHttpR... | java | private HttpClient getClient(int retries, int connectionTimeout, int socketTimeout) {
HttpClient httpClient = new DefaultHttpClient();
HttpParams httpParams = httpClient.getParams();
// Retries
if (retries > 0) {
DefaultHttpRequestRetryHandler retryHandler = new DefaultHttpR... | [
"private",
"HttpClient",
"getClient",
"(",
"int",
"retries",
",",
"int",
"connectionTimeout",
",",
"int",
"socketTimeout",
")",
"{",
"HttpClient",
"httpClient",
"=",
"new",
"DefaultHttpClient",
"(",
")",
";",
"HttpParams",
"httpParams",
"=",
"httpClient",
".",
"... | Returns a DefaultHttpClient instance with retries and timeouts settings
If proxy information exists, its setted on the client.
@param retries int with the retries for the api request
@param connectionTimeout int with the connection timeout for the api request expressed in milliseconds
@param ... | [
"Returns",
"a",
"DefaultHttpClient",
"instance",
"with",
"retries",
"and",
"timeouts",
"settings",
"If",
"proxy",
"information",
"exists",
"its",
"setted",
"on",
"the",
"client",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/net/MPRestClient.java#L146-L171 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/net/MPRestClient.java | MPRestClient.normalizePayload | private HttpEntity normalizePayload(PayloadType payloadType, JsonObject payload, Collection<Header> colHeaders) throws MPRestException {
BasicHeader header = null;
HttpEntity entity = null;
if (payload != null) {
if (payloadType == PayloadType.JSON) {
header = new Bas... | java | private HttpEntity normalizePayload(PayloadType payloadType, JsonObject payload, Collection<Header> colHeaders) throws MPRestException {
BasicHeader header = null;
HttpEntity entity = null;
if (payload != null) {
if (payloadType == PayloadType.JSON) {
header = new Bas... | [
"private",
"HttpEntity",
"normalizePayload",
"(",
"PayloadType",
"payloadType",
",",
"JsonObject",
"payload",
",",
"Collection",
"<",
"Header",
">",
"colHeaders",
")",
"throws",
"MPRestException",
"{",
"BasicHeader",
"header",
"=",
"null",
";",
"HttpEntity",
"entity... | Prepares the payload to be sended in the request.
@param payloadType PayloadType NONE, JSON, FORM_DATA, X_WWW_FORM_URLENCODED
@param payload JosnObject with the payload
@param colHeaders Collection of headers. Content type header will be added by the method
@return
@throw... | [
"Prepares",
"the",
"payload",
"to",
"be",
"sended",
"in",
"the",
"request",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/net/MPRestClient.java#L182-L223 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/net/MPRestClient.java | MPRestClient.getRequestMethod | private HttpRequestBase getRequestMethod(HttpMethod httpMethod, String uri, HttpEntity entity) throws MPRestException {
if (httpMethod == null) {
throw new MPRestException("HttpMethod must be \"GET\", \"POST\", \"PUT\" or \"DELETE\".");
}
if (StringUtils.isEmpty(uri))
thr... | java | private HttpRequestBase getRequestMethod(HttpMethod httpMethod, String uri, HttpEntity entity) throws MPRestException {
if (httpMethod == null) {
throw new MPRestException("HttpMethod must be \"GET\", \"POST\", \"PUT\" or \"DELETE\".");
}
if (StringUtils.isEmpty(uri))
thr... | [
"private",
"HttpRequestBase",
"getRequestMethod",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"uri",
",",
"HttpEntity",
"entity",
")",
"throws",
"MPRestException",
"{",
"if",
"(",
"httpMethod",
"==",
"null",
")",
"{",
"throw",
"new",
"MPRestException",
"(",
... | Returns the HttpRequestBase to be used by the HttpClient.
@param httpMethod a String with the http method to execute
@param uri a String with the uri
@param entity HttpEntity with the normalized payload
@return HttpRequestBase object
@thr... | [
"Returns",
"the",
"HttpRequestBase",
"to",
"be",
"used",
"by",
"the",
"HttpClient",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/net/MPRestClient.java#L234-L268 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCache.java | MPCache.getMapCache | private static HashMap<String, MPApiResponse> getMapCache() {
if (cache == null || cache.get() == null) {
cache = new SoftReference(new HashMap<String, MPApiResponse>());
}
return cache.get();
} | java | private static HashMap<String, MPApiResponse> getMapCache() {
if (cache == null || cache.get() == null) {
cache = new SoftReference(new HashMap<String, MPApiResponse>());
}
return cache.get();
} | [
"private",
"static",
"HashMap",
"<",
"String",
",",
"MPApiResponse",
">",
"getMapCache",
"(",
")",
"{",
"if",
"(",
"cache",
"==",
"null",
"||",
"cache",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"cache",
"=",
"new",
"SoftReference",
"(",
"new",
"... | Auxiliar method. It returns a Map with cached responses from the soft references variable.
If the map does not exists, its instantiated and then returned.
@return HashMap object | [
"Auxiliar",
"method",
".",
"It",
"returns",
"a",
"Map",
"with",
"cached",
"responses",
"from",
"the",
"soft",
"references",
"variable",
".",
"If",
"the",
"map",
"does",
"not",
"exists",
"its",
"instantiated",
"and",
"then",
"returned",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCache.java#L22-L27 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCache.java | MPCache.addToCache | static void addToCache(String key, MPApiResponse response) {
HashMap<String, MPApiResponse> mapCache = getMapCache();
mapCache.put(key, response);
} | java | static void addToCache(String key, MPApiResponse response) {
HashMap<String, MPApiResponse> mapCache = getMapCache();
mapCache.put(key, response);
} | [
"static",
"void",
"addToCache",
"(",
"String",
"key",
",",
"MPApiResponse",
"response",
")",
"{",
"HashMap",
"<",
"String",
",",
"MPApiResponse",
">",
"mapCache",
"=",
"getMapCache",
"(",
")",
";",
"mapCache",
".",
"put",
"(",
"key",
",",
"response",
")",
... | Inserts an entry to the cache.
@param key String with cache entry key
@param response MPApiResponse object to be cached | [
"Inserts",
"an",
"entry",
"to",
"the",
"cache",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCache.java#L35-L38 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCache.java | MPCache.getFromCache | static MPApiResponse getFromCache(String key) {
HashMap<String, MPApiResponse> mapCache = getMapCache();
MPApiResponse response = null;
try {
response = mapCache.get(key).clone();
} catch (Exception ex) {
// Do nothing
}
if (response != null) {
... | java | static MPApiResponse getFromCache(String key) {
HashMap<String, MPApiResponse> mapCache = getMapCache();
MPApiResponse response = null;
try {
response = mapCache.get(key).clone();
} catch (Exception ex) {
// Do nothing
}
if (response != null) {
... | [
"static",
"MPApiResponse",
"getFromCache",
"(",
"String",
"key",
")",
"{",
"HashMap",
"<",
"String",
",",
"MPApiResponse",
">",
"mapCache",
"=",
"getMapCache",
"(",
")",
";",
"MPApiResponse",
"response",
"=",
"null",
";",
"try",
"{",
"response",
"=",
"mapCac... | Retrieves an entry from the cache.
@param key String with cache entry key
@return MPApiResponse cached object, null if it does not exists | [
"Retrieves",
"an",
"entry",
"from",
"the",
"cache",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCache.java#L46-L58 | train |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCache.java | MPCache.removeFromCache | static void removeFromCache(String key) {
HashMap<String, MPApiResponse> mapCache = getMapCache();
mapCache.remove(key);
} | java | static void removeFromCache(String key) {
HashMap<String, MPApiResponse> mapCache = getMapCache();
mapCache.remove(key);
} | [
"static",
"void",
"removeFromCache",
"(",
"String",
"key",
")",
"{",
"HashMap",
"<",
"String",
",",
"MPApiResponse",
">",
"mapCache",
"=",
"getMapCache",
"(",
")",
";",
"mapCache",
".",
"remove",
"(",
"key",
")",
";",
"}"
] | Removes an entry from the cache.
@param key String with cache entry key | [
"Removes",
"an",
"entry",
"from",
"the",
"cache",
"."
] | 9df65a6bfb4db0c1fddd7699a5b109643961b03f | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCache.java#L65-L68 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/util/Settings.java | Settings.loadPropFile | private void loadPropFile(String propFileName) throws IOException, Error {
InputStream inputStream = null;
try {
inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);
if (inputStream != null) {
this.prop.load(inputStream);
LOGGER.debug("properties file " + propFileName + " load... | java | private void loadPropFile(String propFileName) throws IOException, Error {
InputStream inputStream = null;
try {
inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);
if (inputStream != null) {
this.prop.load(inputStream);
LOGGER.debug("properties file " + propFileName + " load... | [
"private",
"void",
"loadPropFile",
"(",
"String",
"propFileName",
")",
"throws",
"IOException",
",",
"Error",
"{",
"InputStream",
"inputStream",
"=",
"null",
";",
"try",
"{",
"inputStream",
"=",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
".",
"ge... | Loads the settings from the properties file
@param propFileName
the name of the file
@throws IOException - if an error occurred when reading from the input stream.
@throws Error - If setting file not found | [
"Loads",
"the",
"settings",
"from",
"the",
"properties",
"file"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/util/Settings.java#L147-L169 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/util/Settings.java | Settings.loadStringProperty | private String loadStringProperty(String propertyKey) {
String propValue = prop.getProperty(propertyKey);
if (propValue != null) {
propValue = propValue.trim();
}
return propValue;
} | java | private String loadStringProperty(String propertyKey) {
String propValue = prop.getProperty(propertyKey);
if (propValue != null) {
propValue = propValue.trim();
}
return propValue;
} | [
"private",
"String",
"loadStringProperty",
"(",
"String",
"propertyKey",
")",
"{",
"String",
"propValue",
"=",
"prop",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"if",
"(",
"propValue",
"!=",
"null",
")",
"{",
"propValue",
"=",
"propValue",
".",
"trim... | Loads a property of the type String from the Properties object
@param propertyKey
the property name
@return the value | [
"Loads",
"a",
"property",
"of",
"the",
"type",
"String",
"from",
"the",
"Properties",
"object"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/util/Settings.java#L179-L185 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/util/Settings.java | Settings.loadBooleanProperty | @SuppressWarnings("unused")
private Boolean loadBooleanProperty(String propertyKey) {
String booleanPropValue = prop.getProperty(propertyKey);
if (booleanPropValue != null) {
return Boolean.parseBoolean(booleanPropValue.trim());
} else {
return null;
}
} | java | @SuppressWarnings("unused")
private Boolean loadBooleanProperty(String propertyKey) {
String booleanPropValue = prop.getProperty(propertyKey);
if (booleanPropValue != null) {
return Boolean.parseBoolean(booleanPropValue.trim());
} else {
return null;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"Boolean",
"loadBooleanProperty",
"(",
"String",
"propertyKey",
")",
"{",
"String",
"booleanPropValue",
"=",
"prop",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"if",
"(",
"booleanPropValue",
"!=",
... | Loads a property of the type Boolean from the Properties object
@param propertyKey
the property name
@return the value | [
"Loads",
"a",
"property",
"of",
"the",
"type",
"Boolean",
"from",
"the",
"Properties",
"object"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/util/Settings.java#L195-L203 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/util/Settings.java | Settings.loadListProperty | @SuppressWarnings("unused")
private List<String> loadListProperty(String propertyKey) {
String arrayPropValue = prop.getProperty(propertyKey);
if (arrayPropValue != null && !arrayPropValue.isEmpty()) {
String [] values = arrayPropValue.trim().split(",");
for (int i = 0; i < values.length; i++) {
values[i... | java | @SuppressWarnings("unused")
private List<String> loadListProperty(String propertyKey) {
String arrayPropValue = prop.getProperty(propertyKey);
if (arrayPropValue != null && !arrayPropValue.isEmpty()) {
String [] values = arrayPropValue.trim().split(",");
for (int i = 0; i < values.length; i++) {
values[i... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"List",
"<",
"String",
">",
"loadListProperty",
"(",
"String",
"propertyKey",
")",
"{",
"String",
"arrayPropValue",
"=",
"prop",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"if",
"(",
"arrayProp... | Loads a property of the type List from the Properties object
@param propertyKey
the property name
@return the value | [
"Loads",
"a",
"property",
"of",
"the",
"type",
"List",
"from",
"the",
"Properties",
"object"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/util/Settings.java#L213-L225 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/util/Settings.java | Settings.loadURLProperty | @SuppressWarnings("unused")
private URL loadURLProperty(String propertyKey) {
String urlPropValue = prop.getProperty(propertyKey);
if (urlPropValue == null || urlPropValue.isEmpty()) {
return null;
} else {
try {
return new URL(urlPropValue.trim());
} catch (MalformedURLException e) {
LOGGER.e... | java | @SuppressWarnings("unused")
private URL loadURLProperty(String propertyKey) {
String urlPropValue = prop.getProperty(propertyKey);
if (urlPropValue == null || urlPropValue.isEmpty()) {
return null;
} else {
try {
return new URL(urlPropValue.trim());
} catch (MalformedURLException e) {
LOGGER.e... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"URL",
"loadURLProperty",
"(",
"String",
"propertyKey",
")",
"{",
"String",
"urlPropValue",
"=",
"prop",
".",
"getProperty",
"(",
"propertyKey",
")",
";",
"if",
"(",
"urlPropValue",
"==",
"null",
"||"... | Loads a property of the type URL from the Properties object
@param propertyKey
the property name
@return the value | [
"Loads",
"a",
"property",
"of",
"the",
"type",
"URL",
"from",
"the",
"Properties",
"object"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/util/Settings.java#L235-L250 | train |
conekta/conekta-java | src/io/conekta/LineItems.java | LineItems.get | public String get(String key) {
try {
Field field;
field = this.getClass().getField(key);
return (String) field.get(this);
} catch(NoSuchFieldException e) {
return (String) antifraud_info.get(key);
} catch(IllegalAccessException e) {
re... | java | public String get(String key) {
try {
Field field;
field = this.getClass().getField(key);
return (String) field.get(this);
} catch(NoSuchFieldException e) {
return (String) antifraud_info.get(key);
} catch(IllegalAccessException e) {
re... | [
"public",
"String",
"get",
"(",
"String",
"key",
")",
"{",
"try",
"{",
"Field",
"field",
";",
"field",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"getField",
"(",
"key",
")",
";",
"return",
"(",
"String",
")",
"field",
".",
"get",
"(",
"this",
... | Helper method to access line item fields | [
"Helper",
"method",
"to",
"access",
"line",
"item",
"fields"
] | c6f088188063ee70f66b77899b92bde2f94dea2c | https://github.com/conekta/conekta-java/blob/c6f088188063ee70f66b77899b92bde2f94dea2c/src/io/conekta/LineItems.java#L36-L46 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getAccessToken | public void getAccessToken() throws OAuthSystemException, OAuthProblemException {
cleanError();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
//OAuthClient oAuthClient = new OAuthClient(httpClient);
OAuthClientRequest request = OAuthClientRequest
.tokenLocation(settings.getURL(C... | java | public void getAccessToken() throws OAuthSystemException, OAuthProblemException {
cleanError();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
//OAuthClient oAuthClient = new OAuthClient(httpClient);
OAuthClientRequest request = OAuthClientRequest
.tokenLocation(settings.getURL(C... | [
"public",
"void",
"getAccessToken",
"(",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
"{",
"cleanError",
"(",
")",
";",
"OneloginURLConnectionClient",
"httpClient",
"=",
"new",
"OneloginURLConnectionClient",
"(",
")",
";",
"//OAuthClient oAuthClien... | Generates an access token and refresh token that you may use to call Onelogin's API methods.
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONAccessTokenResponse and throwOAuthProblem... | [
"Generates",
"an",
"access",
"token",
"and",
"refresh",
"token",
"that",
"you",
"may",
"use",
"to",
"call",
"Onelogin",
"s",
"API",
"methods",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L177-L193 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.refreshToken | public void refreshToken() throws OAuthSystemException, OAuthProblemException {
cleanError();
if (accessToken == null || refreshToken == null) {
throw new OAuthRuntimeException("Access token ot Refresh token not provided");
}
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAut... | java | public void refreshToken() throws OAuthSystemException, OAuthProblemException {
cleanError();
if (accessToken == null || refreshToken == null) {
throw new OAuthRuntimeException("Access token ot Refresh token not provided");
}
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAut... | [
"public",
"void",
"refreshToken",
"(",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
"{",
"cleanError",
"(",
")",
";",
"if",
"(",
"accessToken",
"==",
"null",
"||",
"refreshToken",
"==",
"null",
")",
"{",
"throw",
"new",
"OAuthRuntimeExcep... | Refreshing tokens provides a new set of access and refresh tokens.
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONAccessTokenResponse and throwOAuthProblemException is enabled
@see... | [
"Refreshing",
"tokens",
"provides",
"a",
"new",
"set",
"of",
"access",
"and",
"refresh",
"tokens",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L203-L226 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.revokeToken | public void revokeToken() throws OAuthSystemException, OAuthProblemException {
cleanError();
if (accessToken == null) {
throw new OAuthRuntimeException("Access token not provided");
}
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClientRequest request = OAuthClientReques... | java | public void revokeToken() throws OAuthSystemException, OAuthProblemException {
cleanError();
if (accessToken == null) {
throw new OAuthRuntimeException("Access token not provided");
}
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClientRequest request = OAuthClientReques... | [
"public",
"void",
"revokeToken",
"(",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
"{",
"cleanError",
"(",
")",
";",
"if",
"(",
"accessToken",
"==",
"null",
")",
"{",
"throw",
"new",
"OAuthRuntimeException",
"(",
"\"Access token not provided\... | Revokes an access token and refresh token pair.
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONAccessTokenResponse and throwOAuthProblemException is enabled
@see <a target="_blank"... | [
"Revokes",
"an",
"access",
"token",
"and",
"refresh",
"token",
"pair",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L236-L264 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getRateLimit | public RateLimit getRateLimit() throws OAuthSystemException, OAuthProblemException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
OAuthClientRequest bearerRequest = new OAuthBearerClientRequest... | java | public RateLimit getRateLimit() throws OAuthSystemException, OAuthProblemException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
OAuthClientRequest bearerRequest = new OAuthBearerClientRequest... | [
"public",
"RateLimit",
"getRateLimit",
"(",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"OneloginURLConnectionClient",
"httpClient",
"=",
"new",
"OneloginURLConnectionClient",
"(",... | Gets current rate limit details about an access token.
@return RateLimit object
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is en... | [
"Gets",
"current",
"rate",
"limit",
"details",
"about",
"an",
"access",
"token",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L277-L302 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getUsersBatch | public OneLoginResponse<User> getUsersBatch(int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getUsersBatch(batchSize, null);
} | java | public OneLoginResponse<User> getUsersBatch(int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getUsersBatch(batchSize, null);
} | [
"public",
"OneLoginResponse",
"<",
"User",
">",
"getUsersBatch",
"(",
"int",
"batchSize",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"getUsersBatch",
"(",
"batchSize",
",",
"null",
")",
";",
"}"
] | Get a batch Users.
This is usually the first version of the user batching methods to call as it requires no after-cursor information.
@param batchSize Size of the Batch
@return OneLoginResponse of User (Batch)
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@thro... | [
"Get",
"a",
"batch",
"Users",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L357-L359 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getUserApps | public List<App> getUserApps(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_APPS_FOR_USER_URL, Long.toString(id)));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionC... | java | public List<App> getUserApps(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_APPS_FOR_USER_URL, Long.toString(id)));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionC... | [
"public",
"List",
"<",
"App",
">",
"getUserApps",
"(",
"long",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"=",
"new... | Gets a list of apps accessible by a user, not including personal apps.
@param id
Id of the user
@return List of Apps
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceRespons... | [
"Gets",
"a",
"list",
"of",
"apps",
"accessible",
"by",
"a",
"user",
"not",
"including",
"personal",
"apps",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L548-L578 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getUserRoles | public List<Integer> getUserRoles(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_ROLES_FOR_USER_URL, Long.toString(id)));
OneloginURLConnectionClient httpClient = new OneloginURLConne... | java | public List<Integer> getUserRoles(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_ROLES_FOR_USER_URL, Long.toString(id)));
OneloginURLConnectionClient httpClient = new OneloginURLConne... | [
"public",
"List",
"<",
"Integer",
">",
"getUserRoles",
"(",
"long",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"=",
... | Gets a list of role IDs that have been assigned to a user.
@param id
Id of the user
@return List of Role Ids
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and th... | [
"Gets",
"a",
"list",
"of",
"role",
"IDs",
"that",
"have",
"been",
"assigned",
"to",
"a",
"user",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L595-L618 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.createUser | public User createUser(Map<String, Object> userParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = ne... | java | public User createUser(Map<String, Object> userParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = ne... | [
"public",
"User",
"createUser",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"userParams",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"Onelogi... | Creates an user
@param userParams
User data (firstname, lastname, email, username, company, department, directory_id, distinguished_name,
external_id, group_id, invalid_login_attempts, locale_code, manager_ad_id, member_of, notes, openid_name,
phone, samaccountname, title, userprincipalname)
@return Created user
@th... | [
"Creates",
"an",
"user"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L672-L705 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.createSessionLoginToken | public Object createSessionLoginToken(Map<String, Object> queryParams, String allowedOrigin) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClie... | java | public Object createSessionLoginToken(Map<String, Object> queryParams, String allowedOrigin) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClie... | [
"public",
"Object",
"createSessionLoginToken",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"queryParams",
",",
"String",
"allowedOrigin",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
... | Generates a session login token in scenarios in which MFA may or may not be required.
A session login token expires two minutes after creation.
@param queryParams
Query Parameters (username_or_email, password, subdomain, return_to_url, ip_address, browser_id)
@param allowedOrigin
Custom-Allowed-Origin-Header. Required... | [
"Generates",
"a",
"session",
"login",
"token",
"in",
"scenarios",
"in",
"which",
"MFA",
"may",
"or",
"may",
"not",
"be",
"required",
".",
"A",
"session",
"login",
"token",
"expires",
"two",
"minutes",
"after",
"creation",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L816-L853 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.createSessionLoginToken | public Object createSessionLoginToken(Map<String, Object> queryParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return createSessionLoginToken(queryParams, null);
} | java | public Object createSessionLoginToken(Map<String, Object> queryParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return createSessionLoginToken(queryParams, null);
} | [
"public",
"Object",
"createSessionLoginToken",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"queryParams",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"createSessionLoginToken",
"(",
"queryParams",
","... | Generate a session login token in scenarios in which MFA may or may not be required.
A session login token expires two minutes after creation.
@param queryParams
Query Parameters (username_or_email, password, subdomain, return_to_url, ip_address, browser_id)
@return SessionTokenInfo or SessionTokenMFAInfo object if s... | [
"Generate",
"a",
"session",
"login",
"token",
"in",
"scenarios",
"in",
"which",
"MFA",
"may",
"or",
"may",
"not",
"be",
"required",
".",
"A",
"session",
"login",
"token",
"expires",
"two",
"minutes",
"after",
"creation",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L870-L872 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.assignRoleToUser | public Boolean assignRoleToUser(long id, List<Long> roleIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder ur... | java | public Boolean assignRoleToUser(long id, List<Long> roleIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder ur... | [
"public",
"Boolean",
"assignRoleToUser",
"(",
"long",
"id",
",",
"List",
"<",
"Long",
">",
"roleIds",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",... | Assigns Role to User
@param id
Id of the user to be modified
@param roleIds
Set to an array of one or more role IDs.
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the Onelogin... | [
"Assigns",
"Role",
"to",
"User"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1075-L1105 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.setPasswordUsingHashSalt | public Boolean setPasswordUsingHashSalt(long id, String password, String passwordConfirmation, String passwordAlgorithm) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return setPasswordUsingHashSalt(id, password, passwordConfirmation, passwordAlgorithm, null);
} | java | public Boolean setPasswordUsingHashSalt(long id, String password, String passwordConfirmation, String passwordAlgorithm) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return setPasswordUsingHashSalt(id, password, passwordConfirmation, passwordAlgorithm, null);
} | [
"public",
"Boolean",
"setPasswordUsingHashSalt",
"(",
"long",
"id",
",",
"String",
"password",
",",
"String",
"passwordConfirmation",
",",
"String",
"passwordAlgorithm",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
... | Set Password by ID Using Salt and SHA-256
@param id
Id of the user to be modified
@param password
Set to the password value using a SHA-256-encoded value.
@param passwordConfirmation
This value must match the password value.
@param passwordAlgorithm
Set to salt+sha256.
@return true if success
@throws OAuthSystemExce... | [
"Set",
"Password",
"by",
"ID",
"Using",
"Salt",
"and",
"SHA",
"-",
"256"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1285-L1287 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.logUserOut | public Boolean logUserOut(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBuilder(setting... | java | public Boolean logUserOut(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBuilder(setting... | [
"public",
"Boolean",
"logUserOut",
"(",
"long",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"OneloginURLConnectionClient",
"httpClient",
"=",
"... | Log a user out of any and all sessions.
@param id
Id of the user to be modified
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOA... | [
"Log",
"a",
"user",
"out",
"of",
"any",
"and",
"all",
"sessions",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1399-L1423 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getEventTypes | public List<EventType> getEventTypes() throws URISyntaxException, ClientProtocolException, IOException {
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_EVENT_TYPES_URL));
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(url.toString());
httpGet.setHeader... | java | public List<EventType> getEventTypes() throws URISyntaxException, ClientProtocolException, IOException {
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_EVENT_TYPES_URL));
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(url.toString());
httpGet.setHeader... | [
"public",
"List",
"<",
"EventType",
">",
"getEventTypes",
"(",
")",
"throws",
"URISyntaxException",
",",
"ClientProtocolException",
",",
"IOException",
"{",
"URIBuilder",
"url",
"=",
"new",
"URIBuilder",
"(",
"settings",
".",
"getURL",
"(",
"Constants",
".",
"GE... | List of all OneLogin event types available to the Events API.
@return List of EventType
@throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
@throws IOException - if CloseableHttpClient raises the exception
@throws ClientProtocolException - if CloseableHttpCli... | [
"List",
"of",
"all",
"OneLogin",
"event",
"types",
"available",
"to",
"the",
"Events",
"API",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1919-L1936 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getEvents | public List<Event> getEvents(HashMap<String, String> queryParameters, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = getResource(queryParameters, Constants.GET_EVENTS_URL);
OneloginOAuthJSONResourceResponse oAuthResponse = null;
String afterCu... | java | public List<Event> getEvents(HashMap<String, String> queryParameters, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = getResource(queryParameters, Constants.GET_EVENTS_URL);
OneloginOAuthJSONResourceResponse oAuthResponse = null;
String afterCu... | [
"public",
"List",
"<",
"Event",
">",
"getEvents",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"queryParameters",
",",
"int",
"maxResults",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"ExtractionContext"... | Gets a list of Event resources.
@param queryParameters Query parameters of the Resource
Parameters to filter the result of the list
@param maxResults
Limit the number of events returned (optional)
@return List of Event
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnecti... | [
"Gets",
"a",
"list",
"of",
"Event",
"resources",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1955-L1969 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getEvent | public Event getEvent(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_EVENT_URL, Long.toString(id)));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAut... | java | public Event getEvent(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_EVENT_URL, Long.toString(id)));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAut... | [
"public",
"Event",
"getEvent",
"(",
"long",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"=",
"new",
"URIBuilder",
"(",... | Gets Event by ID.
@param id
Id of the event
@return Event
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
@throws URISynt... | [
"Gets",
"Event",
"by",
"ID",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2122-L2146 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.createEvent | public void createEvent(Map<String, Object> eventParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = ... | java | public void createEvent(Map<String, Object> eventParams) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = ... | [
"public",
"void",
"createEvent",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"eventParams",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"Onelo... | Create an event in the OneLogin event log.
@param eventParams
Event Data (event_type_id, account_id, actor_system, actor_user_id, actor_user_name, app_id,
assuming_acting_user_id, custom_message, directory_sync_run_id, group_id, group_name, ipaddr,
otp_device_id, otp_device_name, policy_id, policy_name, role_id, role_... | [
"Create",
"an",
"event",
"in",
"the",
"OneLogin",
"event",
"log",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2163-L2186 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getGroupsBatch | public OneLoginResponse<Group> getGroupsBatch(HashMap<String, String> queryParameters, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = extractResourceBatch(queryParameters, batchSize, afterCursor, Constants.GET_GROUPS_URL);
L... | java | public OneLoginResponse<Group> getGroupsBatch(HashMap<String, String> queryParameters, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = extractResourceBatch(queryParameters, batchSize, afterCursor, Constants.GET_GROUPS_URL);
L... | [
"public",
"OneLoginResponse",
"<",
"Group",
">",
"getGroupsBatch",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"queryParameters",
",",
"int",
"batchSize",
",",
"String",
"afterCursor",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
... | Get a batch of Groups
@param queryParameters Query parameters of the Resource
@param batchSize Size of the Batch
@param afterCursor Reference to continue collecting items of next page
@return OneLoginResponse of Group
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnectio... | [
"Get",
"a",
"batch",
"of",
"Groups"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2293-L2299 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getFactors | public List<AuthFactor> getFactors(long userId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_FACTORS_URL, userId));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClie... | java | public List<AuthFactor> getFactors(long userId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_FACTORS_URL, userId));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClie... | [
"public",
"List",
"<",
"AuthFactor",
">",
"getFactors",
"(",
"long",
"userId",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"... | Returns a list of authentication factors that are available for user enrollment
via API.
@param userId
The id of the user.
@return Array AuthFactor list
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating ... | [
"Returns",
"a",
"list",
"of",
"authentication",
"factors",
"that",
"are",
"available",
"for",
"user",
"enrollment",
"via",
"API",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2624-L2660 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.enrollFactor | public OTPDevice enrollFactor(long userId, long factorId, String displayName, String number) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.ENROLL_FACTOR_URL, userId));
OneloginURLConnectionCl... | java | public OTPDevice enrollFactor(long userId, long factorId, String displayName, String number) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.ENROLL_FACTOR_URL, userId));
OneloginURLConnectionCl... | [
"public",
"OTPDevice",
"enrollFactor",
"(",
"long",
"userId",
",",
"long",
"factorId",
",",
"String",
"displayName",
",",
"String",
"number",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",... | Enroll a user with a given authentication factor.
@param userId
The id of the user.
@param factorId
The identifier of the factor to enroll the user with.
@param displayName
A name for the users device.
@param number
The phone number of the user in E.164 format.
@return OTPDevice The MFA device
@throws OAuthSystemExc... | [
"Enroll",
"a",
"user",
"with",
"a",
"given",
"authentication",
"factor",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2682-L2715 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.removeFactor | public Boolean removeFactor(long userId, long deviceId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.REMOVE_FACTOR_URL, userId, deviceId));
OneloginURLConnectionClient httpClient = new Onelo... | java | public Boolean removeFactor(long userId, long deviceId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.REMOVE_FACTOR_URL, userId, deviceId));
OneloginURLConnectionClient httpClient = new Onelo... | [
"public",
"Boolean",
"removeFactor",
"(",
"long",
"userId",
",",
"long",
"deviceId",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url... | Remove an enrolled factor from a user.
@param userId
The id of the user.
@param deviceId
The device_id of the MFA device.
@return Boolean True if action succeed
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors val... | [
"Remove",
"an",
"enrolled",
"factor",
"from",
"a",
"user",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2940-L2963 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.generateInviteLink | public String generateInviteLink(String email) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBui... | java | public String generateInviteLink(String email) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBui... | [
"public",
"String",
"generateInviteLink",
"(",
"String",
"email",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"OneloginURLConnectionClient",
"httpClient"... | Generates an invite link for a user that you have already created in your OneLogin account.
@param email
Set to the email address of the user that you want to generate an invite link for.
@return String with the link
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection... | [
"Generates",
"an",
"invite",
"link",
"for",
"a",
"user",
"that",
"you",
"have",
"already",
"created",
"in",
"your",
"OneLogin",
"account",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2983-L3017 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.sendInviteLink | public Boolean sendInviteLink(String email, String personalEmail) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuild... | java | public Boolean sendInviteLink(String email, String personalEmail) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuild... | [
"public",
"Boolean",
"sendInviteLink",
"(",
"String",
"email",
",",
"String",
"personalEmail",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"OneloginU... | Sends an invite link to a user that you have already created in your OneLogin account.
@param email
Set to the email address of the user that you want to send an invite link for.
@param personalEmail
If you want to send the invite email to an email other than the one provided in email,
provide it here. The invite lin... | [
"Sends",
"an",
"invite",
"link",
"to",
"a",
"user",
"that",
"you",
"have",
"already",
"created",
"in",
"your",
"OneLogin",
"account",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3036-L3070 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.sendInviteLink | public Boolean sendInviteLink(String email) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return sendInviteLink(email, null);
} | java | public Boolean sendInviteLink(String email) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return sendInviteLink(email, null);
} | [
"public",
"Boolean",
"sendInviteLink",
"(",
"String",
"email",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"sendInviteLink",
"(",
"email",
",",
"null",
")",
";",
"}"
] | Send an invite link to a user that you have already created in your OneLogin account.
@param email
Set to the email address of the user that you want to send an invite link for.
@return True if the mail with the link was sent
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLC... | [
"Send",
"an",
"invite",
"link",
"to",
"a",
"user",
"that",
"you",
"have",
"already",
"created",
"in",
"your",
"OneLogin",
"account",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3086-L3088 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getEmbedApps | public List<EmbedApp> getEmbedApps(String token, String email) throws URISyntaxException, ClientProtocolException, IOException, ParserConfigurationException, SAXException, XPathExpressionException {
cleanError();
URIBuilder url = new URIBuilder(Constants.EMBED_APP_URL);
url.addParameter("token", token);
url.add... | java | public List<EmbedApp> getEmbedApps(String token, String email) throws URISyntaxException, ClientProtocolException, IOException, ParserConfigurationException, SAXException, XPathExpressionException {
cleanError();
URIBuilder url = new URIBuilder(Constants.EMBED_APP_URL);
url.addParameter("token", token);
url.add... | [
"public",
"List",
"<",
"EmbedApp",
">",
"getEmbedApps",
"(",
"String",
"token",
",",
"String",
"email",
")",
"throws",
"URISyntaxException",
",",
"ClientProtocolException",
",",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXException",
",",
"XPathExpres... | Lists apps accessible by a OneLogin user.
@param token
Provide your embedding token.
@param email
Provide the email of the user for which you want to return a list of apps to be embed.
@return String that contains an XML with the App info
@throws URISyntaxException - if there is an error when generating the target U... | [
"Lists",
"apps",
"accessible",
"by",
"a",
"OneLogin",
"user",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3114-L3152 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getPrivileges | public List<Privilege> getPrivileges() throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.LIST_PRIVILEGES_URL));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClie... | java | public List<Privilege> getPrivileges() throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.LIST_PRIVILEGES_URL));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClie... | [
"public",
"List",
"<",
"Privilege",
">",
"getPrivileges",
"(",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"=",
"new",
"URIB... | Gets a list of the Privileges created in an account.
@return List of Privilege
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is ena... | [
"Gets",
"a",
"list",
"of",
"the",
"Privileges",
"created",
"in",
"an",
"account",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3170-L3200 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.createPrivilege | public Privilege createPrivilege(String name, String version, List<?> statements) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClie... | java | public Privilege createPrivilege(String name, String version, List<?> statements) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClie... | [
"public",
"Privilege",
"createPrivilege",
"(",
"String",
"name",
",",
"String",
"version",
",",
"List",
"<",
"?",
">",
"statements",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
... | Creates a Privilege
@param name
The name of this privilege.
@param version
The version for the privilege schema. Set to 2018-05-18.
@param statements
A list of Statement objects or HashMap<String, Object>
@return Created Privilege
@throws OAuthSystemException - if there is a IOException reading parameters of the htt... | [
"Creates",
"a",
"Privilege"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3220-L3278 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getPrivilege | public Privilege getPrivilege(String id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_PRIVILEGE_URL, id));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuth... | java | public Privilege getPrivilege(String id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_PRIVILEGE_URL, id));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuth... | [
"public",
"Privilege",
"getPrivilege",
"(",
"String",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"=",
"new",
"URIBuilde... | Get a Privilege
@param id
The id of the privilege you want to update.
@return Privilege
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemExcept... | [
"Get",
"a",
"Privilege"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3295-L3319 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.deletePrivilege | public Boolean deletePrivilege(String id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBuilder(... | java | public Boolean deletePrivilege(String id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBuilder(... | [
"public",
"Boolean",
"deletePrivilege",
"(",
"String",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"OneloginURLConnectionClient",
"httpClient",
"... | Deletes a privilege
@param id
Id of the privilege to be deleted
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemExcept... | [
"Deletes",
"a",
"privilege"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3416-L3440 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getRolesAssignedToPrivileges | public List<Long> getRolesAssignedToPrivileges(String id, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = getResource(Constants.GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL, id);
OneloginOAuth2JSONResourceResponse oAuth2Response = null;
String afterCurs... | java | public List<Long> getRolesAssignedToPrivileges(String id, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = getResource(Constants.GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL, id);
OneloginOAuth2JSONResourceResponse oAuth2Response = null;
String afterCurs... | [
"public",
"List",
"<",
"Long",
">",
"getRolesAssignedToPrivileges",
"(",
"String",
"id",
",",
"int",
"maxResults",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"ExtractionContext",
"context",
"=",
"getResource",
... | Gets a list of the role ids assigned to a privilege.
@param id
Id of the privilege
@param maxResults
Limit the number of roles returned
@return List of role Ids
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors val... | [
"Gets",
"a",
"list",
"of",
"the",
"role",
"ids",
"assigned",
"to",
"a",
"privilege",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3458-L3472 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getRolesAssignedToPrivilegesBatch | public OneLoginResponse<Long> getRolesAssignedToPrivilegesBatch(String id, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = extractResourceBatch((Object)id, batchSize, afterCursor, Constants.GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL);... | java | public OneLoginResponse<Long> getRolesAssignedToPrivilegesBatch(String id, int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
ExtractionContext context = extractResourceBatch((Object)id, batchSize, afterCursor, Constants.GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL);... | [
"public",
"OneLoginResponse",
"<",
"Long",
">",
"getRolesAssignedToPrivilegesBatch",
"(",
"String",
"id",
",",
"int",
"batchSize",
",",
"String",
"afterCursor",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"Extract... | Get a batch of roles assigned to privilege.
@param id Id of the privilege
@param batchSize Size of the Batch
@param afterCursor Reference to continue collecting items of next page
@return OneLoginResponse of User (Batch)
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnec... | [
"Get",
"a",
"batch",
"of",
"roles",
"assigned",
"to",
"privilege",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3529-L3535 | train |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.assignUsersToPrivilege | public Boolean assignUsersToPrivilege(String id, List<Long> userIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBu... | java | public Boolean assignUsersToPrivilege(String id, List<Long> userIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBu... | [
"public",
"Boolean",
"assignUsersToPrivilege",
"(",
"String",
"id",
",",
"List",
"<",
"Long",
">",
"userIds",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")"... | Assign one or more users to a privilege.
@param id
Id of the privilege
@param userIds
The ids of the users to be assigned.
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the On... | [
"Assign",
"one",
"or",
"more",
"users",
"to",
"a",
"privilege",
"."
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3792-L3822 | train |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientVerifyBuilder.java | HttpClientVerifyBuilder.called | public void called(Matcher<Integer> numberOfCalls) {
Rule rule = ruleBuilder.toRule();
int matchingCalls = (int)requests.stream()
.filter(req -> rule.matches(req))
.count();
if (!numberOfCalls.matches(matchingCalls)) {
throw new IllegalStateException(... | java | public void called(Matcher<Integer> numberOfCalls) {
Rule rule = ruleBuilder.toRule();
int matchingCalls = (int)requests.stream()
.filter(req -> rule.matches(req))
.count();
if (!numberOfCalls.matches(matchingCalls)) {
throw new IllegalStateException(... | [
"public",
"void",
"called",
"(",
"Matcher",
"<",
"Integer",
">",
"numberOfCalls",
")",
"{",
"Rule",
"rule",
"=",
"ruleBuilder",
".",
"toRule",
"(",
")",
";",
"int",
"matchingCalls",
"=",
"(",
"int",
")",
"requests",
".",
"stream",
"(",
")",
".",
"filte... | Verifies number of request matching defined conditions.
@param numberOfCalls expected number of calls | [
"Verifies",
"number",
"of",
"request",
"matching",
"defined",
"conditions",
"."
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientVerifyBuilder.java#L171-L180 | train |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.withHeader | public HttpClientResponseBuilder withHeader(String name, String value) {
Action lastAction = newRule.getLastAction();
HeaderAction headerAction = new HeaderAction(lastAction, name, value);
newRule.overrideLastAction(headerAction);
return this;
} | java | public HttpClientResponseBuilder withHeader(String name, String value) {
Action lastAction = newRule.getLastAction();
HeaderAction headerAction = new HeaderAction(lastAction, name, value);
newRule.overrideLastAction(headerAction);
return this;
} | [
"public",
"HttpClientResponseBuilder",
"withHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Action",
"lastAction",
"=",
"newRule",
".",
"getLastAction",
"(",
")",
";",
"HeaderAction",
"headerAction",
"=",
"new",
"HeaderAction",
"(",
"lastAction"... | Sets response header.
@param name header name
@param value header value
@return response builder | [
"Sets",
"response",
"header",
"."
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L26-L31 | train |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.withStatus | public HttpClientResponseBuilder withStatus(int statusCode) {
Action lastAction = newRule.getLastAction();
StatusResponse statusAction = new StatusResponse(lastAction, statusCode);
newRule.overrideLastAction(statusAction);
return this;
} | java | public HttpClientResponseBuilder withStatus(int statusCode) {
Action lastAction = newRule.getLastAction();
StatusResponse statusAction = new StatusResponse(lastAction, statusCode);
newRule.overrideLastAction(statusAction);
return this;
} | [
"public",
"HttpClientResponseBuilder",
"withStatus",
"(",
"int",
"statusCode",
")",
"{",
"Action",
"lastAction",
"=",
"newRule",
".",
"getLastAction",
"(",
")",
";",
"StatusResponse",
"statusAction",
"=",
"new",
"StatusResponse",
"(",
"lastAction",
",",
"statusCode"... | Sets response status code.
@param statusCode response status code
@return response builder | [
"Sets",
"response",
"status",
"code",
"."
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L39-L44 | train |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.withCookie | public HttpClientResponseBuilder withCookie(String cookieName, String cookieValue) {
Action lastAction = newRule.getLastAction();
CookieAction cookieAction = new CookieAction(lastAction, cookieName, cookieValue);
newRule.overrideLastAction(cookieAction);
return this;
} | java | public HttpClientResponseBuilder withCookie(String cookieName, String cookieValue) {
Action lastAction = newRule.getLastAction();
CookieAction cookieAction = new CookieAction(lastAction, cookieName, cookieValue);
newRule.overrideLastAction(cookieAction);
return this;
} | [
"public",
"HttpClientResponseBuilder",
"withCookie",
"(",
"String",
"cookieName",
",",
"String",
"cookieValue",
")",
"{",
"Action",
"lastAction",
"=",
"newRule",
".",
"getLastAction",
"(",
")",
";",
"CookieAction",
"cookieAction",
"=",
"new",
"CookieAction",
"(",
... | Sets response cookie
@param cookieName cookie name
@param cookieValue cookie value
@return response builder | [
"Sets",
"response",
"cookie"
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L54-L59 | train |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.doReturn | public HttpClientResponseBuilder doReturn(int statusCode, String response) {
return doReturn(statusCode, response, Charset.forName("UTF-8"));
} | java | public HttpClientResponseBuilder doReturn(int statusCode, String response) {
return doReturn(statusCode, response, Charset.forName("UTF-8"));
} | [
"public",
"HttpClientResponseBuilder",
"doReturn",
"(",
"int",
"statusCode",
",",
"String",
"response",
")",
"{",
"return",
"doReturn",
"(",
"statusCode",
",",
"response",
",",
"Charset",
".",
"forName",
"(",
"\"UTF-8\"",
")",
")",
";",
"}"
] | Adds action which returns provided response in UTF-8 with status code.
@param statusCode status to return
@param response response to return
@return response builder | [
"Adds",
"action",
"which",
"returns",
"provided",
"response",
"in",
"UTF",
"-",
"8",
"with",
"status",
"code",
"."
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L89-L91 | train |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.doThrowException | public HttpClientResponseBuilder doThrowException(IOException exception) {
newRule.addAction(new ExceptionAction(exception));
return new HttpClientResponseBuilder(newRule);
} | java | public HttpClientResponseBuilder doThrowException(IOException exception) {
newRule.addAction(new ExceptionAction(exception));
return new HttpClientResponseBuilder(newRule);
} | [
"public",
"HttpClientResponseBuilder",
"doThrowException",
"(",
"IOException",
"exception",
")",
"{",
"newRule",
".",
"addAction",
"(",
"new",
"ExceptionAction",
"(",
"exception",
")",
")",
";",
"return",
"new",
"HttpClientResponseBuilder",
"(",
"newRule",
")",
";",... | Adds action which throws provided exception.
@param exception exception to be thrown
@return response builder | [
"Adds",
"action",
"which",
"throws",
"provided",
"exception",
"."
] | 0205498434bbc0c78c187a51181cac9b266a28fb | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L134-L137 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java | DatastoreUtils.toNativeFullEntities | static FullEntity<?>[] toNativeFullEntities(List<?> entities, DefaultEntityManager entityManager,
Marshaller.Intent intent) {
FullEntity<?>[] nativeEntities = new FullEntity[entities.size()];
for (int i = 0; i < entities.size(); i++) {
nativeEntities[i] = (FullEntity<?>) Marshaller.marshal(entityMan... | java | static FullEntity<?>[] toNativeFullEntities(List<?> entities, DefaultEntityManager entityManager,
Marshaller.Intent intent) {
FullEntity<?>[] nativeEntities = new FullEntity[entities.size()];
for (int i = 0; i < entities.size(); i++) {
nativeEntities[i] = (FullEntity<?>) Marshaller.marshal(entityMan... | [
"static",
"FullEntity",
"<",
"?",
">",
"[",
"]",
"toNativeFullEntities",
"(",
"List",
"<",
"?",
">",
"entities",
",",
"DefaultEntityManager",
"entityManager",
",",
"Marshaller",
".",
"Intent",
"intent",
")",
"{",
"FullEntity",
"<",
"?",
">",
"[",
"]",
"nat... | Converts the given list of model objects to an array of FullEntity objects.
@param entities
the model objects to convert.
@param entityManager
the entity manager
@param intent
the intent of marshalling
@return the equivalent FullEntity array | [
"Converts",
"the",
"given",
"list",
"of",
"model",
"objects",
"to",
"an",
"array",
"of",
"FullEntity",
"objects",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java#L112-L120 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java | DatastoreUtils.toNativeEntities | static Entity[] toNativeEntities(List<?> entities, DefaultEntityManager entityManager,
Marshaller.Intent intent) {
Entity[] nativeEntities = new Entity[entities.size()];
for (int i = 0; i < entities.size(); i++) {
nativeEntities[i] = (Entity) Marshaller.marshal(entityManager, entities.get(i), intent... | java | static Entity[] toNativeEntities(List<?> entities, DefaultEntityManager entityManager,
Marshaller.Intent intent) {
Entity[] nativeEntities = new Entity[entities.size()];
for (int i = 0; i < entities.size(); i++) {
nativeEntities[i] = (Entity) Marshaller.marshal(entityManager, entities.get(i), intent... | [
"static",
"Entity",
"[",
"]",
"toNativeEntities",
"(",
"List",
"<",
"?",
">",
"entities",
",",
"DefaultEntityManager",
"entityManager",
",",
"Marshaller",
".",
"Intent",
"intent",
")",
"{",
"Entity",
"[",
"]",
"nativeEntities",
"=",
"new",
"Entity",
"[",
"en... | Converts the given list of model objects to an array of native Entity objects.
@param entities
the model objects to convert.
@param entityManager
the entity manager
@param intent
the intent of marshalling
@return the equivalent Entity array | [
"Converts",
"the",
"given",
"list",
"of",
"model",
"objects",
"to",
"an",
"array",
"of",
"native",
"Entity",
"objects",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java#L133-L140 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java | DatastoreUtils.incrementVersion | static Entity incrementVersion(Entity nativeEntity, PropertyMetadata versionMetadata) {
String versionPropertyName = versionMetadata.getMappedName();
long version = nativeEntity.getLong(versionPropertyName);
return Entity.newBuilder(nativeEntity).set(versionPropertyName, ++version).build();
} | java | static Entity incrementVersion(Entity nativeEntity, PropertyMetadata versionMetadata) {
String versionPropertyName = versionMetadata.getMappedName();
long version = nativeEntity.getLong(versionPropertyName);
return Entity.newBuilder(nativeEntity).set(versionPropertyName, ++version).build();
} | [
"static",
"Entity",
"incrementVersion",
"(",
"Entity",
"nativeEntity",
",",
"PropertyMetadata",
"versionMetadata",
")",
"{",
"String",
"versionPropertyName",
"=",
"versionMetadata",
".",
"getMappedName",
"(",
")",
";",
"long",
"version",
"=",
"nativeEntity",
".",
"g... | Increments the version property of the given entity by one.
@param nativeEntity
the target entity
@param versionMetadata
the metadata of the version property
@return a new entity (copy of the given), but with the incremented version. | [
"Increments",
"the",
"version",
"property",
"of",
"the",
"given",
"entity",
"by",
"one",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java#L151-L155 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java | DatastoreUtils.rollbackIfActive | static void rollbackIfActive(Transaction transaction) {
try {
if (transaction != null && transaction.isActive()) {
transaction.rollback();
}
} catch (DatastoreException exp) {
throw new EntityManagerException(exp);
}
} | java | static void rollbackIfActive(Transaction transaction) {
try {
if (transaction != null && transaction.isActive()) {
transaction.rollback();
}
} catch (DatastoreException exp) {
throw new EntityManagerException(exp);
}
} | [
"static",
"void",
"rollbackIfActive",
"(",
"Transaction",
"transaction",
")",
"{",
"try",
"{",
"if",
"(",
"transaction",
"!=",
"null",
"&&",
"transaction",
".",
"isActive",
"(",
")",
")",
"{",
"transaction",
".",
"rollback",
"(",
")",
";",
"}",
"}",
"cat... | Rolls back the given transaction, if it is still active.
@param transaction
the transaction to roll back. | [
"Rolls",
"back",
"the",
"given",
"transaction",
"if",
"it",
"is",
"still",
"active",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java#L163-L171 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java | DatastoreUtils.validateDeferredIdAllocation | static void validateDeferredIdAllocation(Object entity) {
IdentifierMetadata identifierMetadata = EntityIntrospector.getIdentifierMetadata(entity);
if (identifierMetadata.getDataType() == DataType.STRING) {
throw new EntityManagerException(
"Deferred ID allocation is not applicable for entities ... | java | static void validateDeferredIdAllocation(Object entity) {
IdentifierMetadata identifierMetadata = EntityIntrospector.getIdentifierMetadata(entity);
if (identifierMetadata.getDataType() == DataType.STRING) {
throw new EntityManagerException(
"Deferred ID allocation is not applicable for entities ... | [
"static",
"void",
"validateDeferredIdAllocation",
"(",
"Object",
"entity",
")",
"{",
"IdentifierMetadata",
"identifierMetadata",
"=",
"EntityIntrospector",
".",
"getIdentifierMetadata",
"(",
"entity",
")",
";",
"if",
"(",
"identifierMetadata",
".",
"getDataType",
"(",
... | Validates if the given entity is valid for deferred ID allocation. Deferred ID allocation is
valid for entities using a numeric ID.
@param entity
the entity to validate
@throws EntityManagerException
if the given entity does not use a numeric ID | [
"Validates",
"if",
"the",
"given",
"entity",
"is",
"valid",
"for",
"deferred",
"ID",
"allocation",
".",
"Deferred",
"ID",
"allocation",
"is",
"valid",
"for",
"entities",
"using",
"a",
"numeric",
"ID",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DatastoreUtils.java#L216-L223 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/mappers/CollectionMapperFactory.java | CollectionMapperFactory.getMapper | public Mapper getMapper(Field field) {
Type genericType = field.getGenericType();
Property propertyAnnotation = field.getAnnotation(Property.class);
boolean indexed = true;
if (propertyAnnotation != null) {
indexed = propertyAnnotation.indexed();
}
String cacheKey = computeCacheKey(generic... | java | public Mapper getMapper(Field field) {
Type genericType = field.getGenericType();
Property propertyAnnotation = field.getAnnotation(Property.class);
boolean indexed = true;
if (propertyAnnotation != null) {
indexed = propertyAnnotation.indexed();
}
String cacheKey = computeCacheKey(generic... | [
"public",
"Mapper",
"getMapper",
"(",
"Field",
"field",
")",
"{",
"Type",
"genericType",
"=",
"field",
".",
"getGenericType",
"(",
")",
";",
"Property",
"propertyAnnotation",
"=",
"field",
".",
"getAnnotation",
"(",
"Property",
".",
"class",
")",
";",
"boole... | Returns the Mapper for the given field. If a Mapper exists in the cache that can map the given
field, the cached Mapper will be returned. Otherwise, a new Mapper is created and returned.
@param field
the field of an entity for which a Mapper is to be produced.
@return A Mapper to handle the mapping of the field. | [
"Returns",
"the",
"Mapper",
"for",
"the",
"given",
"field",
".",
"If",
"a",
"Mapper",
"exists",
"in",
"the",
"cache",
"that",
"can",
"map",
"the",
"given",
"field",
"the",
"cached",
"Mapper",
"will",
"be",
"returned",
".",
"Otherwise",
"a",
"new",
"Mappe... | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/mappers/CollectionMapperFactory.java#L79-L93 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/mappers/CollectionMapperFactory.java | CollectionMapperFactory.createMapper | private Mapper createMapper(Field field, boolean indexed) {
lock.lock();
try {
Mapper mapper;
Class<?> fieldType = field.getType();
Type genericType = field.getGenericType();
String cacheKey = computeCacheKey(genericType, indexed);
mapper = cache.get(cacheKey);
if (mapper != ... | java | private Mapper createMapper(Field field, boolean indexed) {
lock.lock();
try {
Mapper mapper;
Class<?> fieldType = field.getType();
Type genericType = field.getGenericType();
String cacheKey = computeCacheKey(genericType, indexed);
mapper = cache.get(cacheKey);
if (mapper != ... | [
"private",
"Mapper",
"createMapper",
"(",
"Field",
"field",
",",
"boolean",
"indexed",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Mapper",
"mapper",
";",
"Class",
"<",
"?",
">",
"fieldType",
"=",
"field",
".",
"getType",
"(",
")",
";"... | Creates a new Mapper for the given field.
@param field
the field
@param indexed
whether or not the field is to be indexed
@return the Mapper | [
"Creates",
"a",
"new",
"Mapper",
"for",
"the",
"given",
"field",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/mappers/CollectionMapperFactory.java#L104-L129 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java | EntityManagerFactory.getCredentials | private static Credentials getCredentials(ConnectionParameters parameters) throws IOException {
if (parameters.isEmulator()) {
return NoCredentials.getInstance();
}
InputStream jsonCredentialsStream = parameters.getJsonCredentialsStream();
if (jsonCredentialsStream != null) {
return ServiceA... | java | private static Credentials getCredentials(ConnectionParameters parameters) throws IOException {
if (parameters.isEmulator()) {
return NoCredentials.getInstance();
}
InputStream jsonCredentialsStream = parameters.getJsonCredentialsStream();
if (jsonCredentialsStream != null) {
return ServiceA... | [
"private",
"static",
"Credentials",
"getCredentials",
"(",
"ConnectionParameters",
"parameters",
")",
"throws",
"IOException",
"{",
"if",
"(",
"parameters",
".",
"isEmulator",
"(",
")",
")",
"{",
"return",
"NoCredentials",
".",
"getInstance",
"(",
")",
";",
"}",... | Creates and returns the credentials from the given connection parameters.
@param parameters
the connection parameters
@return the credentials for authenticating with the Datastore service.
@throws IOException
if any error occurs such as not able to read the credentials file. | [
"Creates",
"and",
"returns",
"the",
"credentials",
"from",
"the",
"given",
"connection",
"parameters",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java#L273-L286 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java | EntityManagerFactory.getHttpTransportOptions | private static HttpTransportOptions getHttpTransportOptions(ConnectionParameters parameters) {
HttpTransportOptions.Builder httpOptionsBuilder = HttpTransportOptions.newBuilder();
httpOptionsBuilder.setConnectTimeout(parameters.getConnectionTimeout());
httpOptionsBuilder.setReadTimeout(parameters.getReadTim... | java | private static HttpTransportOptions getHttpTransportOptions(ConnectionParameters parameters) {
HttpTransportOptions.Builder httpOptionsBuilder = HttpTransportOptions.newBuilder();
httpOptionsBuilder.setConnectTimeout(parameters.getConnectionTimeout());
httpOptionsBuilder.setReadTimeout(parameters.getReadTim... | [
"private",
"static",
"HttpTransportOptions",
"getHttpTransportOptions",
"(",
"ConnectionParameters",
"parameters",
")",
"{",
"HttpTransportOptions",
".",
"Builder",
"httpOptionsBuilder",
"=",
"HttpTransportOptions",
".",
"newBuilder",
"(",
")",
";",
"httpOptionsBuilder",
".... | Creates and returns HttpTransportOptions from the given connection parameters.
@param parameters
the connection parameters
@return the HttpTransportOptions | [
"Creates",
"and",
"returns",
"HttpTransportOptions",
"from",
"the",
"given",
"connection",
"parameters",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java#L295-L305 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.introspect | public static EntityMetadata introspect(Class<?> entityClass) {
EntityMetadata cachedMetadata = cache.get(entityClass);
if (cachedMetadata != null) {
return cachedMetadata;
}
return loadMetadata(entityClass);
} | java | public static EntityMetadata introspect(Class<?> entityClass) {
EntityMetadata cachedMetadata = cache.get(entityClass);
if (cachedMetadata != null) {
return cachedMetadata;
}
return loadMetadata(entityClass);
} | [
"public",
"static",
"EntityMetadata",
"introspect",
"(",
"Class",
"<",
"?",
">",
"entityClass",
")",
"{",
"EntityMetadata",
"cachedMetadata",
"=",
"cache",
".",
"get",
"(",
"entityClass",
")",
";",
"if",
"(",
"cachedMetadata",
"!=",
"null",
")",
"{",
"return... | Introspects the given entity class and returns the metadata of the entity.
@param entityClass
the entity class to introspect
@return the metadata of the entity | [
"Introspects",
"the",
"given",
"entity",
"class",
"and",
"returns",
"the",
"metadata",
"of",
"the",
"entity",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L113-L119 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.loadMetadata | private static EntityMetadata loadMetadata(Class<?> entityClass) {
synchronized (entityClass) {
EntityMetadata metadata = cache.get(entityClass);
if (metadata == null) {
EntityIntrospector introspector = new EntityIntrospector(entityClass);
introspector.process();
metadata = intr... | java | private static EntityMetadata loadMetadata(Class<?> entityClass) {
synchronized (entityClass) {
EntityMetadata metadata = cache.get(entityClass);
if (metadata == null) {
EntityIntrospector introspector = new EntityIntrospector(entityClass);
introspector.process();
metadata = intr... | [
"private",
"static",
"EntityMetadata",
"loadMetadata",
"(",
"Class",
"<",
"?",
">",
"entityClass",
")",
"{",
"synchronized",
"(",
"entityClass",
")",
"{",
"EntityMetadata",
"metadata",
"=",
"cache",
".",
"get",
"(",
"entityClass",
")",
";",
"if",
"(",
"metad... | Loads the metadata for the given class and puts it in the cache and returns it.
@param entityClass
the entity class
@return the metadata for the given class | [
"Loads",
"the",
"metadata",
"for",
"the",
"given",
"class",
"and",
"puts",
"it",
"in",
"the",
"cache",
"and",
"returns",
"it",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L128-L139 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.process | private void process() {
Entity entity = entityClass.getAnnotation(Entity.class);
ProjectedEntity projectedEntity = entityClass.getAnnotation(ProjectedEntity.class);
if (entity != null) {
initEntityMetadata(entity);
} else if (projectedEntity != null) {
initEntityMetadata(projectedEntity);
... | java | private void process() {
Entity entity = entityClass.getAnnotation(Entity.class);
ProjectedEntity projectedEntity = entityClass.getAnnotation(ProjectedEntity.class);
if (entity != null) {
initEntityMetadata(entity);
} else if (projectedEntity != null) {
initEntityMetadata(projectedEntity);
... | [
"private",
"void",
"process",
"(",
")",
"{",
"Entity",
"entity",
"=",
"entityClass",
".",
"getAnnotation",
"(",
"Entity",
".",
"class",
")",
";",
"ProjectedEntity",
"projectedEntity",
"=",
"entityClass",
".",
"getAnnotation",
"(",
"ProjectedEntity",
".",
"class"... | Processes the entity class using reflection and builds the metadata. | [
"Processes",
"the",
"entity",
"class",
"using",
"reflection",
"and",
"builds",
"the",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L144-L169 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processPropertyOverrides | private void processPropertyOverrides() {
PropertyOverrides propertyOverrides = entityClass.getAnnotation(PropertyOverrides.class);
if (propertyOverrides == null) {
return;
}
PropertyOverride[] propertyOverridesArray = propertyOverrides.value();
for (PropertyOverride propertyOverride : propert... | java | private void processPropertyOverrides() {
PropertyOverrides propertyOverrides = entityClass.getAnnotation(PropertyOverrides.class);
if (propertyOverrides == null) {
return;
}
PropertyOverride[] propertyOverridesArray = propertyOverrides.value();
for (PropertyOverride propertyOverride : propert... | [
"private",
"void",
"processPropertyOverrides",
"(",
")",
"{",
"PropertyOverrides",
"propertyOverrides",
"=",
"entityClass",
".",
"getAnnotation",
"(",
"PropertyOverrides",
".",
"class",
")",
";",
"if",
"(",
"propertyOverrides",
"==",
"null",
")",
"{",
"return",
";... | Processes the property overrides for the embedded objects, if any. | [
"Processes",
"the",
"property",
"overrides",
"for",
"the",
"embedded",
"objects",
"if",
"any",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L203-L212 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processFields | private void processFields() {
List<Field> fields = getAllFields();
for (Field field : fields) {
if (field.isAnnotationPresent(Identifier.class)) {
processIdentifierField(field);
} else if (field.isAnnotationPresent(Key.class)) {
processKeyField(field);
} else if (field.isAnnot... | java | private void processFields() {
List<Field> fields = getAllFields();
for (Field field : fields) {
if (field.isAnnotationPresent(Identifier.class)) {
processIdentifierField(field);
} else if (field.isAnnotationPresent(Key.class)) {
processKeyField(field);
} else if (field.isAnnot... | [
"private",
"void",
"processFields",
"(",
")",
"{",
"List",
"<",
"Field",
">",
"fields",
"=",
"getAllFields",
"(",
")",
";",
"for",
"(",
"Field",
"field",
":",
"fields",
")",
"{",
"if",
"(",
"field",
".",
"isAnnotationPresent",
"(",
"Identifier",
".",
"... | Processes the fields defined in this entity and updates the metadata. | [
"Processes",
"the",
"fields",
"defined",
"in",
"this",
"entity",
"and",
"updates",
"the",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L217-L232 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.getAllFields | private List<Field> getAllFields() {
List<Field> allFields = new ArrayList<>();
Class<?> clazz = entityClass;
boolean stop;
do {
List<Field> fields = IntrospectionUtils.getPersistableFields(clazz);
allFields.addAll(fields);
clazz = clazz.getSuperclass();
stop = clazz == null || !... | java | private List<Field> getAllFields() {
List<Field> allFields = new ArrayList<>();
Class<?> clazz = entityClass;
boolean stop;
do {
List<Field> fields = IntrospectionUtils.getPersistableFields(clazz);
allFields.addAll(fields);
clazz = clazz.getSuperclass();
stop = clazz == null || !... | [
"private",
"List",
"<",
"Field",
">",
"getAllFields",
"(",
")",
"{",
"List",
"<",
"Field",
">",
"allFields",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"entityClass",
";",
"boolean",
"stop",
";",
"do",
"{",
... | Processes the entity class and any super classes that are MappedSupperClasses and returns the
fields.
@return all fields of the entity hierarchy. | [
"Processes",
"the",
"entity",
"class",
"and",
"any",
"super",
"classes",
"that",
"are",
"MappedSupperClasses",
"and",
"returns",
"the",
"fields",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L240-L251 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processIdentifierField | private void processIdentifierField(Field field) {
Identifier identifier = field.getAnnotation(Identifier.class);
boolean autoGenerated = identifier.autoGenerated();
IdentifierMetadata identifierMetadata = new IdentifierMetadata(field, autoGenerated);
entityMetadata.setIdentifierMetadata(identifierMetad... | java | private void processIdentifierField(Field field) {
Identifier identifier = field.getAnnotation(Identifier.class);
boolean autoGenerated = identifier.autoGenerated();
IdentifierMetadata identifierMetadata = new IdentifierMetadata(field, autoGenerated);
entityMetadata.setIdentifierMetadata(identifierMetad... | [
"private",
"void",
"processIdentifierField",
"(",
"Field",
"field",
")",
"{",
"Identifier",
"identifier",
"=",
"field",
".",
"getAnnotation",
"(",
"Identifier",
".",
"class",
")",
";",
"boolean",
"autoGenerated",
"=",
"identifier",
".",
"autoGenerated",
"(",
")"... | Processes the identifier field and builds the identifier metadata.
@param field
the identifier field | [
"Processes",
"the",
"identifier",
"field",
"and",
"builds",
"the",
"identifier",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L259-L264 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processKeyField | private void processKeyField(Field field) {
String fieldName = field.getName();
Class<?> type = field.getType();
if (!type.equals(DatastoreKey.class)) {
String message = String.format("Invalid type, %s, for Key field %s in class %s. ", type,
fieldName, entityClass);
throw new EntityMan... | java | private void processKeyField(Field field) {
String fieldName = field.getName();
Class<?> type = field.getType();
if (!type.equals(DatastoreKey.class)) {
String message = String.format("Invalid type, %s, for Key field %s in class %s. ", type,
fieldName, entityClass);
throw new EntityMan... | [
"private",
"void",
"processKeyField",
"(",
"Field",
"field",
")",
"{",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"Class",
"<",
"?",
">",
"type",
"=",
"field",
".",
"getType",
"(",
")",
";",
"if",
"(",
"!",
"type",
".",
"eq... | Processes the Key field and builds the entity metadata.
@param field
the Key field | [
"Processes",
"the",
"Key",
"field",
"and",
"builds",
"the",
"entity",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L272-L282 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processParentKeyField | private void processParentKeyField(Field field) {
String fieldName = field.getName();
Class<?> type = field.getType();
if (!type.equals(DatastoreKey.class)) {
String message = String.format("Invalid type, %s, for ParentKey field %s in class %s. ", type,
fieldName, entityClass);
throw n... | java | private void processParentKeyField(Field field) {
String fieldName = field.getName();
Class<?> type = field.getType();
if (!type.equals(DatastoreKey.class)) {
String message = String.format("Invalid type, %s, for ParentKey field %s in class %s. ", type,
fieldName, entityClass);
throw n... | [
"private",
"void",
"processParentKeyField",
"(",
"Field",
"field",
")",
"{",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"Class",
"<",
"?",
">",
"type",
"=",
"field",
".",
"getType",
"(",
")",
";",
"if",
"(",
"!",
"type",
".",... | Processes the ParentKey field and builds the entity metadata.
@param field
the ParentKey field | [
"Processes",
"the",
"ParentKey",
"field",
"and",
"builds",
"the",
"entity",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L290-L300 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processField | private void processField(Field field) {
PropertyMetadata propertyMetadata = IntrospectionUtils.getPropertyMetadata(field);
if (propertyMetadata != null) {
// If the field is from a super class, there might be some
// overrides, so process those.
if (!field.getDeclaringClass().equals(entityCla... | java | private void processField(Field field) {
PropertyMetadata propertyMetadata = IntrospectionUtils.getPropertyMetadata(field);
if (propertyMetadata != null) {
// If the field is from a super class, there might be some
// overrides, so process those.
if (!field.getDeclaringClass().equals(entityCla... | [
"private",
"void",
"processField",
"(",
"Field",
"field",
")",
"{",
"PropertyMetadata",
"propertyMetadata",
"=",
"IntrospectionUtils",
".",
"getPropertyMetadata",
"(",
"field",
")",
";",
"if",
"(",
"propertyMetadata",
"!=",
"null",
")",
"{",
"// If the field is from... | Processes the given field and generates the metadata.
@param field
the field to process | [
"Processes",
"the",
"given",
"field",
"and",
"generates",
"the",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L308-L325 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processVersionField | private void processVersionField(PropertyMetadata propertyMetadata) {
Class<?> dataClass = propertyMetadata.getDeclaredType();
if (!long.class.equals(dataClass)) {
String messageFormat = "Field %s in class %s must be of type %s";
throw new EntityManagerException(String.format(messageFormat,
... | java | private void processVersionField(PropertyMetadata propertyMetadata) {
Class<?> dataClass = propertyMetadata.getDeclaredType();
if (!long.class.equals(dataClass)) {
String messageFormat = "Field %s in class %s must be of type %s";
throw new EntityManagerException(String.format(messageFormat,
... | [
"private",
"void",
"processVersionField",
"(",
"PropertyMetadata",
"propertyMetadata",
")",
"{",
"Class",
"<",
"?",
">",
"dataClass",
"=",
"propertyMetadata",
".",
"getDeclaredType",
"(",
")",
";",
"if",
"(",
"!",
"long",
".",
"class",
".",
"equals",
"(",
"d... | Processes the Version annotation of the field with the given metadata.
@param propertyMetadata
the metadata of the field that has the Version annotation. | [
"Processes",
"the",
"Version",
"annotation",
"of",
"the",
"field",
"with",
"the",
"given",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L333-L341 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.validateAutoTimestampField | private void validateAutoTimestampField(PropertyMetadata propertyMetadata) {
Class<?> dataClass = propertyMetadata.getDeclaredType();
if (Collections.binarySearch(VALID_TIMESTAMP_TYPES, dataClass.getName()) < 0) {
String messageFormat = "Field %s in class %s must be one of the following types - %s";
... | java | private void validateAutoTimestampField(PropertyMetadata propertyMetadata) {
Class<?> dataClass = propertyMetadata.getDeclaredType();
if (Collections.binarySearch(VALID_TIMESTAMP_TYPES, dataClass.getName()) < 0) {
String messageFormat = "Field %s in class %s must be one of the following types - %s";
... | [
"private",
"void",
"validateAutoTimestampField",
"(",
"PropertyMetadata",
"propertyMetadata",
")",
"{",
"Class",
"<",
"?",
">",
"dataClass",
"=",
"propertyMetadata",
".",
"getDeclaredType",
"(",
")",
";",
"if",
"(",
"Collections",
".",
"binarySearch",
"(",
"VALID_... | Validates the given property metadata to ensure it is valid for an automatic timestamp field.
@param propertyMetadata
the metadata to validate | [
"Validates",
"the",
"given",
"property",
"metadata",
"to",
"ensure",
"it",
"is",
"valid",
"for",
"an",
"automatic",
"timestamp",
"field",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L371-L378 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.applyPropertyOverride | private void applyPropertyOverride(PropertyMetadata propertyMetadata) {
String name = propertyMetadata.getName();
Property override = entityMetadata.getPropertyOverride(name);
if (override != null) {
String mappedName = override.name();
if (mappedName != null && mappedName.trim().length() > 0) {... | java | private void applyPropertyOverride(PropertyMetadata propertyMetadata) {
String name = propertyMetadata.getName();
Property override = entityMetadata.getPropertyOverride(name);
if (override != null) {
String mappedName = override.name();
if (mappedName != null && mappedName.trim().length() > 0) {... | [
"private",
"void",
"applyPropertyOverride",
"(",
"PropertyMetadata",
"propertyMetadata",
")",
"{",
"String",
"name",
"=",
"propertyMetadata",
".",
"getName",
"(",
")",
";",
"Property",
"override",
"=",
"entityMetadata",
".",
"getPropertyOverride",
"(",
"name",
")",
... | Applies any override information for the property with the given metadata.
@param propertyMetadata
the metadata of the property | [
"Applies",
"any",
"override",
"information",
"for",
"the",
"property",
"with",
"the",
"given",
"metadata",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L386-L398 | train |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java | EntityIntrospector.processEmbeddedField | private void processEmbeddedField(Field field) {
// First create EmbeddedField so we can maintain the path/depth of the
// embedded field
EmbeddedField embeddedField = new EmbeddedField(field);
// Introspect the embedded field.
EmbeddedMetadata embeddedMetadata = EmbeddedIntrospector.introspect(embe... | java | private void processEmbeddedField(Field field) {
// First create EmbeddedField so we can maintain the path/depth of the
// embedded field
EmbeddedField embeddedField = new EmbeddedField(field);
// Introspect the embedded field.
EmbeddedMetadata embeddedMetadata = EmbeddedIntrospector.introspect(embe... | [
"private",
"void",
"processEmbeddedField",
"(",
"Field",
"field",
")",
"{",
"// First create EmbeddedField so we can maintain the path/depth of the",
"// embedded field",
"EmbeddedField",
"embeddedField",
"=",
"new",
"EmbeddedField",
"(",
"field",
")",
";",
"// Introspect the e... | Processes and gathers the metadata for the given embedded field.
@param field
the embedded field | [
"Processes",
"and",
"gathers",
"the",
"metadata",
"for",
"the",
"given",
"embedded",
"field",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L406-L414 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.