*/
static final @NonNull JavaTypeName OVERRIDE = JavaTypeName.create(Override.class);
/**
- * {@code java.lang.SuppressWarnings} as a JavaTypeName.
+ * {@code java.lang.void} as a JavaTypeName.
*/
static final @NonNull JavaTypeName SUPPRESS_WARNINGS = JavaTypeName.create(SuppressWarnings.class);
+ /**
+ * {@code java.lang.SuppressWarnings} as a JavaTypeName.
+ */
+ static final @NonNull JavaTypeName VOID = JavaTypeName.create(void.class);
/**
* {@code java.util.Arrays} as a JavaTypeName.
return null;
}
+ /**
+ * Generate a call to {@link Object#clone()} if target field represents an array. Returns an empty string otherwise.
+ *
+ * @param property Generated property
+ * @return The string used to clone the property, or an empty string
+ */
+ static final String cloneCall(final GeneratedProperty property) {
+ return property.getReturnType().getName().endsWith("[]") ? ".clone()" : "";
+ }
+
/**
* Returns set of method signature instances which contains all the methods of the <code>genType</code>
* and all the methods of the implemented interfaces.