/** * For a Java field annotated with the {@code Facebook} annotation, figure out * what the corresponding Facebook JSON field name to map to it is. * * @param fieldWithAnnotation * A Java field annotated with the {@code Facebook} annotation. * @return The Facebook JSON field name that should be mapped to this Java * field. */ protected String getFacebookFieldName(FieldWithAnnotation<Facebook> fieldWithAnnotation) { String facebookFieldName = fieldWithAnnotation.getAnnotation().value(); Field field = fieldWithAnnotation.getField(); // If no Facebook field name was specified in the annotation, assume // it's the same name as the Java field if (isBlank(facebookFieldName)) { if (logger.isLoggable(FINEST)) logger.finest("No explicit Facebook field name found for " + field + ", so defaulting to the field name itself (" + field.getName() + ")"); facebookFieldName = field.getName(); } return facebookFieldName; }
/** * For a Java field annotated with the {@code Facebook} annotation, figure out what the corresponding Facebook JSON * field name to map to it is. * * @param fieldWithAnnotation * A Java field annotated with the {@code Facebook} annotation. * @return The Facebook JSON field name that should be mapped to this Java field. */ protected String getFacebookFieldName(FieldWithAnnotation<Facebook> fieldWithAnnotation) { String facebookFieldName = fieldWithAnnotation.getAnnotation().value(); Field field = fieldWithAnnotation.getField(); // If no Facebook field name was specified in the annotation, assume // it's the same name as the Java field if (isBlank(facebookFieldName)) { MAPPER_LOGGER.trace("No explicit Facebook field name found for {}, so defaulting to the field name itself ({})", field, field.getName()); facebookFieldName = field.getName(); } return facebookFieldName; }