com.covisint.platform.oauth.client.subject.SubjectClientBuilder Maven / Gradle / Ivy
/*
* Copyright 2015 Covisint
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.covisint.platform.oauth.client.subject;
import static com.covisint.platform.oauth.core.SupportedMediaType.SUBJECT_MT;
import com.covisint.core.http.service.client.BaseResourceClientBuilder;
import com.covisint.core.support.constraint.Nonnull;
import com.covisint.core.support.constraint.NotEmpty;
import com.google.common.net.MediaType;
/** Build class for {@link SubjectClient}s. */
public class SubjectClientBuilder extends BaseResourceClientBuilder {
/** Base path to the resource collection endpoint. */
private static final String RESOURCE_COLLECTION_PATH = "/subjects";
/** Media type of a subject resource representation. */
private static final MediaType MEDIA_TYPE = MediaType.parse(SUBJECT_MT.value());
/** {@inheritDoc} */
@Nonnull
@NotEmpty
protected String getResourceCollectionPath() {
return RESOURCE_COLLECTION_PATH;
}
/** {@inheritDoc} */
@Nonnull
protected MediaType getResourceRepresentation() {
return MEDIA_TYPE;
}
/** {@inheritDoc} */
@Nonnull
public SubjectClientImpl build() {
final SubjectClientImpl impl = populateBaseBuilder(new SubjectClientImpl());
return impl;
}
}