/** * Safely get Display name from a type with null checks * * @param type * The RAML TypeDeclaration to check * @return The display name if defined or null if empty */ public static String getDisplayName(TypeDeclaration type) { if (type == null || type.displayName() == null) { return null; } else { return type.displayName().value(); } }
if (Config.getOverrideNamingLogicWith() == OverrideNamingLogicWith.DISPLAY_NAME && objectProperty.displayName() != null) { fieldName = NamingHelper.getParameterName(objectProperty.displayName().value()); } else if (Config.getOverrideNamingLogicWith() == OverrideNamingLogicWith.ANNOTATION) { for (AnnotationRef annotation : objectProperty.annotations()) {
m.body().forEach(b -> { if (b.displayName() != null) debug("Content Type " + b.displayName().value()); String contentType = (b.displayName() != null) ? b.displayName().value() : null; debug("Content Type " + contentType);