Fixing compiler warnings
This commit is contained in:
parent
cf02621275
commit
4413c299ea
|
@ -19,7 +19,7 @@ import java.util.concurrent.Executor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link Executor} with an additional method for shutdown. We could have just used
|
* An {@link Executor} with an additional method for shutdown. We could have just used
|
||||||
* {@link java.util.concurent.ExecutorService}, however, that requires too many methods to be
|
* {@link java.util.concurrent.ExecutorService}, however, that requires too many methods to be
|
||||||
* implemented.
|
* implemented.
|
||||||
*
|
*
|
||||||
* @author inder
|
* @author inder
|
||||||
|
|
|
@ -36,22 +36,27 @@ public class ContentBodySpec implements ParamMapSpec {
|
||||||
this.paramsSpec = Collections.unmodifiableMap(paramsSpec);
|
this.paramsSpec = Collections.unmodifiableMap(paramsSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Type getTypeFor(String paramName) {
|
public Type getTypeFor(String paramName) {
|
||||||
return paramsSpec.get(paramName);
|
return paramsSpec.get(paramName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean checkIfCompatible(String paramName, Type type) {
|
public boolean checkIfCompatible(String paramName, Type type) {
|
||||||
return type.equals(getTypeFor(paramName));
|
return type.equals(getTypeFor(paramName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean checkIfCompatible(String paramName, Object object) {
|
public boolean checkIfCompatible(String paramName, Object object) {
|
||||||
return checkIfCompatible(paramName, object.getClass());
|
return checkIfCompatible(paramName, object.getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Set<Map.Entry<String, Type>> entrySet() {
|
public Set<Map.Entry<String, Type>> entrySet() {
|
||||||
return paramsSpec.entrySet();
|
return paramsSpec.entrySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return paramsSpec.size();
|
return paramsSpec.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,12 @@ public final class HeaderMapSpec implements ParamMapSpec {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Type getTypeFor(String headerName) {
|
public Type getTypeFor(String headerName) {
|
||||||
return map.get(headerName);
|
return map.get(headerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Set<Map.Entry<String, Type>> entrySet() {
|
public Set<Map.Entry<String, Type>> entrySet() {
|
||||||
return map.entrySet();
|
return map.entrySet();
|
||||||
}
|
}
|
||||||
|
@ -63,6 +65,7 @@ public final class HeaderMapSpec implements ParamMapSpec {
|
||||||
return rawClassOfHeader.isAssignableFrom(rawClassOfTargetType);
|
return rawClassOfHeader.isAssignableFrom(rawClassOfTargetType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean checkIfCompatible(String headerName, Object headerValue) {
|
public boolean checkIfCompatible(String headerName, Object headerValue) {
|
||||||
return checkIfCompatible(headerName, headerValue.getClass());
|
return checkIfCompatible(headerName, headerValue.getClass());
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ package com.google.gson.webservice.definition.rest;
|
||||||
*
|
*
|
||||||
* @author inder
|
* @author inder
|
||||||
*
|
*
|
||||||
* @param <T> type of object
|
* @param <R> type of object
|
||||||
*/
|
*/
|
||||||
public interface HasId<R> {
|
public interface HasId<R> {
|
||||||
public Id<R> getId();
|
public Id<R> getId();
|
||||||
|
|
|
@ -62,7 +62,7 @@ public final class MetaData<R extends RestResource<R>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getString(String key) {
|
public String getString(String key) {
|
||||||
return (String) map.get(key);
|
return map.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putString(String key, String value) {
|
public void putString(String key, String value) {
|
||||||
|
@ -83,7 +83,7 @@ public final class MetaData<R extends RestResource<R>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getFromTransient(Object key) {
|
public Object getFromTransient(Object key) {
|
||||||
return (String) mapTransient.get(key);
|
return mapTransient.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putInTransient(Object key, Object value) {
|
public void putInTransient(Object key, Object value) {
|
||||||
|
|
|
@ -49,6 +49,6 @@ public final class ResourceMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
public RestCallSpec get(CallPath callPath) {
|
public RestCallSpec get(CallPath callPath) {
|
||||||
return (RestCallSpec)resources.get(callPath);
|
return resources.get(callPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class IdMap<T extends HasId<T>> {
|
||||||
private final Type typeOfId;
|
private final Type typeOfId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use {@link #create(Class)} instead of constructor
|
* Use {@link #create(Type)} instead of constructor
|
||||||
*/
|
*/
|
||||||
protected IdMap(Type typeOfId) {
|
protected IdMap(Type typeOfId) {
|
||||||
this.typeOfId = typeOfId;
|
this.typeOfId = typeOfId;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user