private void validateParent(String type) { TimelineEntityType parentType = TimelineEntityType.valueOf(type); TimelineEntityType thisType = TimelineEntityType.valueOf(getType()); if (!thisType.isParent(parentType)) { throw new IllegalArgumentException( type + " is not the acceptable parent of " + this.getType()); } }