package ryhma57.references;

import java.util.EnumSet;
import ryhma57.backend.BibtexReferenceField;
import static ryhma57.backend.BibtexReferenceField.*;

public class Book extends Reference {
    private static EnumSet<BibtexReferenceField> existingFields;
    private static EnumSet<BibtexReferenceField> requiredFields;

    static {
        EnumSet<BibtexReferenceField> optionals;
        Book.requiredFields = Reference.createFieldSet(AUTHOR,
                TITLE, YEAR, PUBLISHER);
        optionals = Reference.createFieldSet(VOLUME,
                NUMBER, SERIES, ADDRESS, EDITION, MONTH, NOTE);

        Book.existingFields = Reference.createExistingSet(
                Book.requiredFields, optionals);
    }

    public Book(String id, String author, String title, String year, String publisher) {
        super(existingFields, requiredFields, "book");
        setID(id);
        setField(AUTHOR, author);
        setField(TITLE, title);
        setField(YEAR, year);
        setField(PUBLISHER, publisher);
    }
}

@@ -318,72 +318,39 @@
 elds
-;%0A%0A    static %7B%0A        EnumSet%3CBibtexReferenceField%3E optionals;
+, optionalFields;%0A%0A    static %7B
 %0A   
@@ -458,24 +458,29 @@
         
+Book.
 optional
 s = Refe
@@ -471,16 +471,21 @@
 optional
+Field
 s = Refe
@@ -577,17 +577,16 @@
  NOTE);%0A
-%0A
         
@@ -673,24 +673,29 @@
 Fields, 
+Book.
 optional
 s);%0A    
@@ -686,16 +686,21 @@
 optional
+Field
 s);%0A    
@@ -1007,10 +1007,91 @@
 ;%0A    %7D%0A
+    public Book() %7B%0A        super(existingFields, requiredFields, %22book%22);%0A    %7D%0A
 %7D%0A

Simplify the book class even more.