Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* #%L
* Apache Geronimo JAX-RS Spec 2.0
* %%
* Copyright (C) 2003 - 2014 The Apache Software Foundation
* %%
* 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.
* #L%
*/
package javax.ws.rs.client;
import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.Locale;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Variant;
public final class Entity {
private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
private final T entity;
private final Variant variant;
private final Annotation[] annotations;
public static Entity entity(final T entity, final MediaType mediaType) {
return new Entity(entity, mediaType);
}
public static Entity entity(final T entity, final MediaType mediaType, Annotation[] annotations) {
return new Entity(entity, mediaType, annotations);
}
public static Entity entity(final T entity, final String mediaType) {
return new Entity(entity, MediaType.valueOf(mediaType));
}
public static Entity entity(final T entity, final Variant variant) {
return new Entity(entity, variant);
}
public static Entity entity(final T entity, final Variant variant, Annotation[] annotations) {
return new Entity(entity, variant, annotations);
}
public static Entity text(final T entity) {
return new Entity(entity, MediaType.TEXT_PLAIN_TYPE);
}
public static Entity xml(final T entity) {
return new Entity(entity, MediaType.APPLICATION_XML_TYPE);
}
public static Entity json(final T entity) {
return new Entity(entity, MediaType.APPLICATION_JSON_TYPE);
}
public static Entity html(final T entity) {
return new Entity(entity, MediaType.TEXT_HTML_TYPE);
}
public static Entity xhtml(final T entity) {
return new Entity(entity, MediaType.APPLICATION_XHTML_XML_TYPE);
}
public static Entity