def private generateLengthMethod(String methodName, String varName) '''
«IF restrictions != null && !(restrictions.lengthConstraints.empty)»
«val numberClass = restrictions.lengthConstraints.iterator.next.min.class»
+ /**
+ * @deprecated This method is slated for removal in a future release. See BUG-1485 for details.
+ */
+ @Deprecated
public static «List.importedName»<«Range.importedName»<«numberClass.importedNumber»>> «methodName»() {
return «varName»;
}
def private generateRangeMethod(String methodName, String varName) '''
«IF restrictions != null && !(restrictions.rangeConstraints.empty)»
«val returnType = allProperties.iterator.next.returnType»
+ /**
+ * @deprecated This method is slated for removal in a future release. See BUG-1485 for details.
+ */
+ @Deprecated
public static «List.importedName»<«Range.importedName»<«returnType.importedNumber»>> «methodName»() {
return «varName»;
}
«IF !enclosedGeneratedTypes.empty»
«FOR innerClass : enclosedGeneratedTypes SEPARATOR "\n"»
«IF (innerClass instanceof GeneratedTransferObject)»
- «val classTemplate = new ClassTemplate(innerClass as GeneratedTransferObject)»
+ «val classTemplate = new ClassTemplate(innerClass)»
«classTemplate.generateAsInnerClass»
«ENDIF»
«FOR p : properties»
«IF p.returnType.importedName.contains("[]")»
- this.«p.fieldName» = Arrays.copyOf(«p.fieldName», «p.fieldName».length);
+ this.«p.fieldName» = «p.fieldName» == null ? null : «p.fieldName».clone();
«ELSE»
this.«p.fieldName» = «p.fieldName»;
«ENDIF»
«IF c.name == TypeConstants.PATTERN_CONSTANT_NAME»
«val cValue = c.value»
«IF cValue instanceof List<?>»
- «val cValues = cValue as List<?>»
private static final «List.importedName»<«Pattern.importedName»> «Constants.MEMBER_PATTERN_LIST»;
public static final «List.importedName»<String> «TypeConstants.PATTERN_CONSTANT_NAME» = «ImmutableList.importedName».of(«
- FOR v : cValues SEPARATOR ", "»«
+ FOR v : cValue SEPARATOR ", "»«
IF v instanceof String»"«
- v as String»"«
+ v»"«
ENDIF»«
ENDFOR»);