Esempio n. 1
0
 public Builder<BUILDER, C> type(final ContentTypeName type) {
   if (type.isDescendantOfMedia() && !(this instanceof Media.Builder)) {
     throw new IllegalArgumentException("Please create Builder via Media when creating a Media");
   }
   this.type = type;
   return this;
 }
Esempio n. 2
0
 public static Builder create(final ContentTypeName type) {
   if (type.isPageTemplate()) {
     final PageTemplate.Builder builder = PageTemplate.newPageTemplate();
     builder.type(type);
     return builder;
   } else if (type.isSite()) {
     Site.Builder builder = Site.create();
     builder.type(type);
     return builder;
   } else if (type.isDescendantOfMedia()) {
     Media.Builder builder = Media.create();
     builder.type(type);
     return builder;
   } else {
     Builder builder = Content.create();
     builder.type(type);
     return builder;
   }
 }