diff options
author | 2018-07-25 18:13:18 +0800 | |
---|---|---|
committer | 2018-07-25 18:13:18 +0800 | |
commit | 4f27ba159b9786fd440c7b07f19da26b5a65786c (patch) | |
tree | db811b3f98618a37ffac9494b528291835e8e7a8 /keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java | |
parent | a9bc456b0de6ad5158665f960e4860269544ce46 (diff) |
fix keystone code issues
Issue-ID: SO-729
Change-Id: Ia3f30f048499b5f8b3654cb851f140aa1707bd63
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java')
-rw-r--r-- | keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java index 30c915c..c27ab8b 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java @@ -23,38 +23,38 @@ import com.woorea.openstack.base.client.OpenStackRequest; public class GenericResource<One, Many> { - protected final OpenStackClient CLIENT; - - protected CharSequence path; - - protected Class<One> oneClass; - protected Class<Many> manyClass; - - public GenericResource(OpenStackClient client, CharSequence path, Class<One> oneClass, Class<Many> manyClass) { - CLIENT = client; - this.path = path; - this.oneClass = oneClass; - this.manyClass = manyClass; - } - - public OpenStackRequest<Many> list() { - return new OpenStackRequest<>(CLIENT, HttpMethod.GET, path, null, manyClass); - } - - public OpenStackRequest<One> create(One one) { - return new OpenStackRequest<>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); - } - - public OpenStackRequest<One> show(String id) { - return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); - } - - public OpenStackRequest<One> update(String id, One one) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); - } - - public OpenStackRequest<One> delete(String id) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); - } - + protected final OpenStackClient CLIENT; + + protected CharSequence path; + + protected Class<One> oneClass; + protected Class<Many> manyClass; + + public GenericResource(OpenStackClient client, CharSequence path, Class<One> oneClass, Class<Many> manyClass) { + CLIENT = client; + this.path = path; + this.oneClass = oneClass; + this.manyClass = manyClass; + } + + public OpenStackRequest<Many> list() { + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, path, null, manyClass); + } + + public OpenStackRequest<One> create(One one) { + return new OpenStackRequest<>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); + } + + public OpenStackRequest<One> show(String id) { + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + } + + public OpenStackRequest<One> update(String id, One one) { + return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); + } + + public OpenStackRequest<One> delete(String id) { + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + } + } |