下面列出了javax.persistence.Transient#com.fasterxml.jackson.annotation.JsonIgnore 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@JsonIgnore
public Map<String, String> asMap() {
Map<String, String> map = new HashMap<>();
if (formatted != null) {
map.put("formatted", formatted);
}
if (streetAddress != null) {
map.put("streetAddress", streetAddress);
}
if (locality != null) {
map.put("locality", locality);
}
if (region != null) {
map.put("region", region);
}
if (postalCode != null) {
map.put("postalCode", postalCode);
}
if (country != null) {
map.put("country", country);
}
return Collections.unmodifiableMap(map);
}
@JsonIgnore
public String getUnique() {
if (topic == null) {
return user;
}
if (user == null) {
return topic;
}
return topic + ":" + user;
}
@JsonIgnore
@Override
public Collection<Object> getAttributeKeys() throws InvalidSessionException {
Map<Object, Object> attributes = getAttributes();
if (isNull(attributes)) {
return emptySet();
}
return attributes.keySet();
}
private Map<String, Schema> getPropertiesFromClassDeclaration(
TypeDeclaration<?> typeDeclaration) {
Map<String, Schema> properties = new TreeMap<>();
for (FieldDeclaration field : typeDeclaration.getFields()) {
if (field.isTransient() || field.isStatic()
|| field.isAnnotationPresent(JsonIgnore.class)) {
continue;
}
Optional<String> fieldDescription = field.getJavadoc()
.map(javadoc -> javadoc.getDescription().toText());
field.getVariables().forEach(variableDeclarator -> {
Schema propertySchema = parseTypeToSchema(
variableDeclarator.getType(),
fieldDescription.orElse(""));
if (field.isAnnotationPresent(Nullable.class)
|| GeneratorUtils.isTrue(propertySchema.getNullable())) {
// Temporarily set nullable to indicate this property is
// not required
propertySchema.setNullable(true);
}
addFieldAnnotationsToSchema(field, propertySchema);
properties.put(variableDeclarator.getNameAsString(),
propertySchema);
});
}
return properties;
}
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
java.util.List<java.lang.String> names = super.getFieldNames();
names.add("grab-on-hover");
return names;
}
@JsonIgnore
@Override
public ConfigPhase getConfigPhase() {
if (isConfigSection()) {
return configDocSection.getConfigPhase();
} else if (isConfigKey()) {
return configDocKey.getConfigPhase();
}
return null;
}
@JsonIgnore
public TransformSpec getLastSpec() {
final TransformSpec lastSpec;
if ((specList.size() > 0)) {
lastSpec = specList.get(specList.size() - 1);
} else {
lastSpec = null;
}
return lastSpec;
}
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
java.util.List<java.lang.String> names = super.getFieldNames();
names.add("format");
return names;
}
@JsonIgnore
public String getEndpointUri() {
String answer = getUri();
if (parameters != null) {
try {
answer = URISupport.appendParametersToURI(answer, parameters);
} catch (URISyntaxException | UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
return answer;
}
@JsonIgnore
public CacheProfile getCacheProfile(boolean skipCache, boolean autoConfig) {
// Cache is manually deactivated, either for the space or for this specific request
if (getCacheTTL() == 0 || skipCache) {
return CacheProfile.NO_CACHE;
}
// Cache is manually set -> use those settings instead
if (getCacheTTL() > 0) {
return new CacheProfile(getCacheTTL() / 3, getCacheTTL(), Long.MAX_VALUE, getContentUpdatedAt());
}
// Automatic cache configuration is not active.
if (!autoConfig) {
return CacheProfile.NO_CACHE;
}
double volatility = getVolatility();
long timeSinceLastUpdate = Service.currentTimeMillis() - getContentUpdatedAt();
// 0 min to 2 min -> no cache
if (timeSinceLastUpdate < 2 * CONTENT_UPDATED_AT_INTERVAL_MILLIS) {
return CacheProfile.NO_CACHE;
}
// 2 min to (1 hour + volatility penalty time ) -> cache only in the service
long volatilityPenalty = (long) (volatility * volatility * TimeUnit.DAYS.toMillis(7));
if (timeSinceLastUpdate < TimeUnit.HOURS.toMillis(1) + volatilityPenalty) {
return new CacheProfile(0, 0, CacheProfile.MAX_SERVICE_TTL, getContentUpdatedAt());
}
// no changes for more than (1 hour + volatility penalty time ) -> cache in the service and in the browser
return new CacheProfile(TimeUnit.MINUTES.toMillis(3), TimeUnit.HOURS.toMillis(24), CacheProfile.MAX_SERVICE_TTL,
getContentUpdatedAt());
}
/**
*
* @deprecated see {@link #getHostConfig()}
*/
@Deprecated
@CheckForNull
@JsonIgnore
default Long getMemory() {
return getHostConfig().getMemory();
}
/**
* checks if interface descriptor is certain type.
* @param type type to check
*/
@JsonIgnore
public boolean isType(String type) {
String haveType;
if (id.startsWith("_")) {
haveType = "system";
} else if (interfaceType == null) {
haveType = "proxy";
} else {
haveType = interfaceType;
}
return type.equals(haveType);
}
@JsonIgnore
public boolean equipItem(Item item) {
EquipmentType type = getTypeFor(item);
if (type == null || type.getType() != 0)
return false;
equipment.put(type, Items.idOf(item));
if (item instanceof Breakable) //should always be?
durability.put(type, ((Breakable) item).getMaxDurability());
return true;
}
@JsonIgnore
@Deprecated
public Path getFolder() {
Proxy bundledAs = getBundledAs();
if (bundledAs == null) {
return null;
}
return bundledAs.getFolder();
}
/**
* Returns set of {@link NodeInterfacePair}s representing all interfaces with {@link
* InterfaceRuntimeData#getLineUp() lineUp} set to {@code false}.
*/
@JsonIgnore
@Nonnull
public Set<NodeInterfacePair> getBlacklistedInterfaces() {
return _runtimeData.entrySet().stream()
.flatMap(
nodeEntry ->
nodeEntry.getValue().getInterfaces().entrySet().stream()
.filter(ifaceEntry -> Objects.equals(ifaceEntry.getValue().getLineUp(), false))
.map(
ifaceEntry ->
NodeInterfacePair.of(nodeEntry.getKey(), ifaceEntry.getKey())))
.collect(ImmutableSet.toImmutableSet());
}
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
java.util.List<java.lang.String> names = super.getFieldNames();
names.add("members");
return names;
}
/**
* Get routing entries as list.
*/
@JsonIgnore
public List<RoutingEntry> getAllRoutingEntries() {
List<RoutingEntry> all = new ArrayList<>();
if (handlers != null) {
Collections.addAll(all, handlers);
}
return all;
}
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
java.util.List<java.lang.String> names = super.getFieldNames();
names.add("result");
names.add("responsible-properties");
return names;
}
/**
* Get the hierarchies of the associated dataset
* @return
*/
@JsonIgnore
public Set<HierarchyWrapper> getHierarchies(){
Set<HierarchyWrapper> hierarchies = new HashSet<HierarchyWrapper>();
for (Iterator<MeasureCatalogueDimension> iterator = datasetDimensions.iterator(); iterator.hasNext();) {
MeasureCatalogueDimension dimensionWrapper = (MeasureCatalogueDimension) iterator.next();
hierarchies.add(dimensionWrapper.getHierarchy());
}
return hierarchies;
}
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
java.util.List<java.lang.String> names = super.getFieldNames();
names.add("cpu-state");
return names;
}
@JsonIgnore
public void setOccupation(String occupation) {
this.occupation = occupation;
}
@JsonIgnore
@Override
public byte getSecond() {
return this.value.getSecond();
}
@JsonIgnore
public ActionType getAction() {
return ActionType.get(action);
}
@JsonIgnore
public String getAddressee() {
return getAddressees().isEmpty() ? "" : getAddressees().get(0);
}
@JsonIgnore
public boolean dataIsSVMFormat() {
return getBoolean(params, "isSVMData", false);
}
@JsonIgnore
public List<MinorFragmentIndexEndpoint> getProvidingEndpoints() {
return senders;
}
@JsonIgnore
@Override
public String getToken() {
return getAccessToken();
}
@JsonIgnore
@Override
default Map<String, String> getSourceFileFields() {
return ImmutableMap.of("source", "Output files (.zip)");
}
@JsonIgnore
public boolean isEmpty()
{
return elements.isEmpty();
}
@JsonIgnore
public abstract JobKey getJobKey();