package org.schoellerfamily.gedbrowser.api.datamodel;

import java.util.List;

/**
 * @author Dick Schoeller
 */
public final class ApiSource extends ApiObject {
    /** */
    private static final long serialVersionUID = 2L;

    /**
     * The title string.
     */
    private final String title;

    /**
     * Constructor.
     */
    public ApiSource() {
        super();
        this.title = "Unknown";
    }

    /**
     * Constructor.
     *
     * @param type a string describing the data type of this object
     * @param string a string containing the primary value of this object
     * @param title the title of the source
     */
    public ApiSource(final String type, final String string,
            final String title) {
        super(type, string);
        this.title = title;
    }

    /**
     * Constructor.
     *
     * @param type a string describing the data type of this object
     * @param string a string containing the primary value of this object
     * @param attributes the list of subordinate attributes of this object
     * @param title the title of the source
     */
    public ApiSource(final String type, final String string,
            final List<ApiAttribute> attributes, final String title) {
        super(type, string, attributes);
        this.title = title;
    }

    /**
     * @return the title string
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param visitor the visitor
     */
    public void accept(final ApiObjectVisitor visitor) {
        visitor.visit(this);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + ((title == null) ? 0 : title.hashCode());
        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (getClass() != obj.getClass())
            return false;
        ApiSource other = (ApiSource) obj;
        if (title == null) {
            if (other.title != null)
                return false;
        } else if (!title.equals(other.title))
            return false;
        return true;
    }
}

@@ -1748,71 +1748,226 @@
 t + 
-((
 title
- == null) ? 0 :
+Hash();%0A        return result;%0A    %7D%0A%0A    /**%0A     * @return the
  title
-.
+'s 
 hash
-Code());%0A        return result
+ code%0A     */%0A    private int titleHash() %7B%0A        if (title == null) %7B%0A            return 0;%0A        %7D%0A        return title.hashCode()
 ;%0A  
@@ -2048,16 +2048,22 @@
  equals(
+final 
 Object o
@@ -2092,16 +2092,18 @@
  == obj)
+ %7B
 %0A       
@@ -2116,24 +2116,34 @@
 eturn true;%0A
+        %7D%0A
         if (
@@ -2161,16 +2161,18 @@
 ls(obj))
+ %7B
 %0A       
@@ -2182,32 +2182,42 @@
   return false;%0A
+        %7D%0A
         if (getC
@@ -2241,16 +2241,18 @@
 Class())
+ %7B
 %0A       
@@ -2262,32 +2262,42 @@
   return false;%0A
+        %7D%0A
         ApiSourc
@@ -2388,16 +2388,18 @@
 != null)
+ %7B
 %0A       
@@ -2413,32 +2413,46 @@
   return false;%0A
+            %7D%0A
         %7D else i
@@ -2481,16 +2481,18 @@
 .title))
+ %7B
 %0A       
@@ -2502,32 +2502,42 @@
   return false;%0A
+        %7D%0A
         return t

fix checkstyle/codeclimate warnings in hashcode and equals