Java Code Examples for com.fasterxml.jackson.annotation.JsonIgnore

The following examples show how to use com.fasterxml.jackson.annotation.JsonIgnore. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: syncope   Source File: SCIMUserAddressConf.java    License: Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 2
Source Project: tindroid   Source File: Subscription.java    License: Apache License 2.0 5 votes vote down vote up
@JsonIgnore
public String getUnique() {
    if (topic == null) {
        return user;
    }
    if (user == null) {
        return topic;
    }
    return topic + ":" + user;
}
 
Example 3
Source Project: super-cloudops   Source File: IamSession.java    License: Apache License 2.0 5 votes vote down vote up
@JsonIgnore
@Override
public Collection<Object> getAttributeKeys() throws InvalidSessionException {
	Map<Object, Object> attributes = getAttributes();
	if (isNull(attributes)) {
		return emptySet();
	}
	return attributes.keySet();
}
 
Example 4
Source Project: flow   Source File: OpenApiObjectGenerator.java    License: Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 5
Source Project: qemu-java   Source File: DisplayGTK.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 6
Source Project: quarkus   Source File: ConfigDocItem.java    License: Apache License 2.0 5 votes vote down vote up
@JsonIgnore
@Override
public ConfigPhase getConfigPhase() {
    if (isConfigSection()) {
        return configDocSection.getConfigPhase();
    } else if (isConfigKey()) {
        return configDocKey.getConfigPhase();
    }

    return null;
}
 
Example 7
Source Project: render   Source File: ListTransformSpec.java    License: GNU General Public License v2.0 5 votes vote down vote up
@JsonIgnore
public TransformSpec getLastSpec() {
    final TransformSpec lastSpec;
    if ((specList.size() > 0)) {
        lastSpec = specList.get(specList.size() - 1);
    } else {
        lastSpec = null;
    }
    return lastSpec;
}
 
Example 8
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
	java.util.List<java.lang.String> names = super.getFieldNames();
	names.add("format");
	return names;
}
 
Example 9
Source Project: camel-k-runtime   Source File: WireTapStepParser.java    License: Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 10
Source Project: xyz-hub   Source File: Space.java    License: Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example 11
Source Project: docker-java   Source File: CreateContainerCmd.java    License: Apache License 2.0 5 votes vote down vote up
/**
 *
 * @deprecated see {@link #getHostConfig()}
 */
@Deprecated
@CheckForNull
@JsonIgnore
default Long getMemory() {
    return getHostConfig().getMemory();
}
 
Example 12
Source Project: okapi   Source File: InterfaceDescriptor.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 13
Source Project: MantaroBot   Source File: PlayerEquipment.java    License: GNU General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example 14
Source Project: incubator-taverna-language   Source File: PathMetadata.java    License: Apache License 2.0 5 votes vote down vote up
@JsonIgnore
@Deprecated
public Path getFolder() {
	Proxy bundledAs = getBundledAs();
	if (bundledAs == null) {
		return null;
	}
	return bundledAs.getFolder();
}
 
Example 15
Source Project: batfish   Source File: SnapshotRuntimeData.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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());
}
 
Example 16
@JsonIgnore
@Override
public java.util.List<java.lang.String> getFieldNames() {
	java.util.List<java.lang.String> names = super.getFieldNames();
	names.add("members");
	return names;
}
 
Example 17
Source Project: okapi   Source File: InterfaceDescriptor.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Get routing entries as list.
 */
@JsonIgnore
public List<RoutingEntry> getAllRoutingEntries() {
  List<RoutingEntry> all = new ArrayList<>();
  if (handlers != null) {
    Collections.addAll(all, handlers);
  }
  return all;
}
 
Example 18
@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;
}
 
Example 19
/**
 * 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;
}
 
Example 20
Source Project: qemu-java   Source File: CpuInfoS390.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 21
Source Project: sdk-rest   Source File: CorporateUser.java    License: MIT License 4 votes vote down vote up
@JsonIgnore
public void setOccupation(String occupation) {
	this.occupation = occupation;
}
 
Example 22
Source Project: Wikidata-Toolkit   Source File: TimeValueImpl.java    License: Apache License 2.0 4 votes vote down vote up
@JsonIgnore
@Override
public byte getSecond() {
	return this.value.getSecond();
}
 
Example 23
Source Project: TelegramBots   Source File: SendChatAction.java    License: MIT License 4 votes vote down vote up
@JsonIgnore
public ActionType getAction() {
    return ActionType.get(action);
}
 
Example 24
@JsonIgnore
public String getAddressee() {
    return getAddressees().isEmpty() ? "" : getAddressees().get(0);
}
 
Example 25
Source Project: ltr4l   Source File: AbstractSVM.java    License: Apache License 2.0 4 votes vote down vote up
@JsonIgnore
public boolean dataIsSVMFormat() {
  return getBoolean(params, "isSVMData", false);
}
 
Example 26
Source Project: dremio-oss   Source File: UnorderedReceiver.java    License: Apache License 2.0 4 votes vote down vote up
@JsonIgnore
public List<MinorFragmentIndexEndpoint> getProvidingEndpoints() {
  return senders;
}
 
Example 27
@JsonIgnore
@Override
public String getToken() {
  return getAccessToken();
}
 
Example 28
@JsonIgnore
@Override
default Map<String, String> getSourceFileFields() {
    return ImmutableMap.of("source", "Output files (.zip)");
}
 
Example 29
@JsonIgnore
public boolean isEmpty()
{
	return elements.isEmpty();
}
 
Example 30
Source Project: quartz-redis-jobstore   Source File: TriggerMixin.java    License: Apache License 2.0 4 votes vote down vote up
@JsonIgnore
public abstract JobKey getJobKey();