this.redirectTarget = redirectTarget;
}
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @java.lang.Override
+ public String toString() {
+ return ((insert != null) ? String.valueOf(insert) : "") + "|" + ((contentType != null) ? contentType : "") + "|" + ((redirectTarget != null) ? redirectTarget : "");
+ }
+
+ /**
+ * Converts an override string created by {@link #toString()} back to an
+ * {@link Override} object.
+ *
+ * @param overrideString
+ * The textual representation of the override
+ * @return The parsed override, or <code>null</code> if the string could
+ * not be parsed
+ */
+ public static Override valueOf(String overrideString) {
+ Override override = new Override();
+ String[] parts = overrideString.split("\\|");
+ if (parts.length < 3) {
+ return null;
+ }
+ if (parts[0].length() > 0) {
+ override.insert = Boolean.valueOf(parts[0]);
+ }
+ if (parts[1].length() > 0) {
+ override.contentType = parts[1];
+ }
+ if (parts[2].length() > 0) {
+ override.redirectTarget = parts[2];
+ }
+ return override;
+ }
+
}