Skip to content

Commit 06b5f4f

Browse files
authored
Fix typo in "getOptionalCustomAttribute(..)" method name (#1250)
1 parent abfe54f commit 06b5f4f

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

gitlab4j-api/src/main/java/org/gitlab4j/api/GroupApi.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,8 +2255,23 @@ public CustomAttribute getCustomAttribute(final Object groupIdOrPath, final Stri
22552255
* @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance, required
22562256
* @param key the key for the custom attribute, required
22572257
* @return an Optional instance with the value for a single custom attribute for the specified group
2258+
* @deprecated use {@link #getOptionalCustomAttribute(Object, String)} instead
22582259
*/
2260+
@Deprecated
22592261
public Optional<CustomAttribute> geOptionalCustomAttribute(final Object groupIdOrPath, final String key) {
2262+
return getOptionalCustomAttribute(groupIdOrPath, key);
2263+
}
2264+
2265+
/**
2266+
* Get an Optional instance with the value for a single custom attribute for the specified group.
2267+
*
2268+
* <pre><code>GitLab Endpoint: GET /groups/:id/custom_attributes/:key</code></pre>
2269+
*
2270+
* @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance, required
2271+
* @param key the key for the custom attribute, required
2272+
* @return an Optional instance with the value for a single custom attribute for the specified group
2273+
*/
2274+
public Optional<CustomAttribute> getOptionalCustomAttribute(final Object groupIdOrPath, final String key) {
22602275
try {
22612276
return (Optional.ofNullable(getCustomAttribute(groupIdOrPath, key)));
22622277
} catch (GitLabApiException glae) {

gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4354,8 +4354,23 @@ public CustomAttribute getCustomAttribute(final Object projectIdOrPath, final St
43544354
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required
43554355
* @param key the key for the custom attribute, required
43564356
* @return an Optional instance with the value for a single custom attribute for the specified project
4357+
* @deprecated Use {@link #getOptionalCustomAttribute(Object, String)} instead
43574358
*/
4359+
@Deprecated
43584360
public Optional<CustomAttribute> geOptionalCustomAttribute(final Object projectIdOrPath, final String key) {
4361+
return getOptionalCustomAttribute(projectIdOrPath, key);
4362+
}
4363+
4364+
/**
4365+
* Get an Optional instance with the value for a single custom attribute for the specified project.
4366+
*
4367+
* <pre><code>GitLab Endpoint: GET /projects/:id/custom_attributes/:key</code></pre>
4368+
*
4369+
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required
4370+
* @param key the key for the custom attribute, required
4371+
* @return an Optional instance with the value for a single custom attribute for the specified project
4372+
*/
4373+
public Optional<CustomAttribute> getOptionalCustomAttribute(final Object projectIdOrPath, final String key) {
43594374
try {
43604375
return (Optional.ofNullable(getCustomAttribute(projectIdOrPath, key)));
43614376
} catch (GitLabApiException glae) {

gitlab4j-api/src/test/java/org/gitlab4j/api/TestGroupCustomAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void testGetCustomAttribute() throws GitLabApiException {
145145
CustomAttribute newCustomAttribute = createCustomAttribute(key, value);
146146
assertNotNull(newCustomAttribute);
147147

148-
Optional<CustomAttribute> customAttribute = gitLabApi.getGroupApi().geOptionalCustomAttribute(testGroup, key);
148+
Optional<CustomAttribute> customAttribute = gitLabApi.getGroupApi().getOptionalCustomAttribute(testGroup, key);
149149
assertTrue(customAttribute.isPresent());
150150
assertEquals(key, customAttribute.get().getKey());
151151
assertEquals(value, customAttribute.get().getValue());

gitlab4j-api/src/test/java/org/gitlab4j/api/TestProjectCustomAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void testGetCustomAttribute() throws GitLabApiException {
147147
assertNotNull(newCustomAttribute);
148148

149149
Optional<CustomAttribute> customAttribute =
150-
gitLabApi.getProjectApi().geOptionalCustomAttribute(testProject, key);
150+
gitLabApi.getProjectApi().getOptionalCustomAttribute(testProject, key);
151151
assertTrue(customAttribute.isPresent());
152152
assertEquals(key, customAttribute.get().getKey());
153153
assertEquals(value, customAttribute.get().getValue());

0 commit comments

Comments
 (0)