package org.atlasapi.content;

import static com.google.common.base.Preconditions.checkNotNull;

import org.atlasapi.meta.annotations.FieldName;

import com.google.common.base.Objects;
import com.metabroadcast.common.intl.Country;

public class Certificate {

    //TODO make some static final instantiations?
    
    private final Country country;
    private final String classification;

    public Certificate(String classification, Country country) {
        this.classification = checkNotNull(classification);
        this.country = checkNotNull(country);
    }

    @FieldName("country")
    public Country country() {
        return country;
    }

    @FieldName("classification")
    public String classification() {
        return classification;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that instanceof Certificate) {
            Certificate other = (Certificate) that;
            return classification.equals(other.classification) && country.equals(other.country);
        }
        return false;
    }
    
    @Override
    public int hashCode() {
        return Objects.hashCode(classification, country);
    }
    
    @Override
    public String toString() {
        return String.format("%s (%s)", classification, country.code());
    }
}

@@ -320,22 +320,16 @@
 private 
-final 
 Country 
@@ -349,22 +349,16 @@
 private 
-final 
 String c
@@ -373,16 +373,51 @@
 ation;%0A%0A
+    public Certificate() %7B%0A%0A    %7D%0A%0A
     publ
@@ -533,16 +533,16 @@
 ation);%0A
-
         
@@ -578,32 +578,229 @@
 ountry);%0A    %7D%0A%0A
+    public void setClassification(String classification) %7B%0A        this.classification = classification;%0A    %7D%0A%0A    public void setCountry(Country country) %7B%0A        this.country = country;%0A    %7D%0A%0A
     @FieldName(%22

Add nullary constructor for Certificates