package com.u.teach.model;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.u.teach.model.entity.Picture;
import java.io.Serializable;

/**
 * Expertise model
 *
 * Expertise is a measure for knowing
 * how much a Professor has already taught.
 * The more lessons he has given, the higher
 * his expertise will be.
 *
 * Created by saguilera on 1/9/17.
 */
@SuppressWarnings("unused")
public final class Expertise implements Serializable {

    private long value;
    private @NonNull Picture badge;

    Expertise() {
        super();
    }

    Expertise(@NonNull Builder builder) {
        this.value = builder.value;
        this.badge = builder.badge;
    }

    public @NonNull Picture badge() {
        return badge;
    }

    public @NonNull long value() {
        return value;
    }

    public @NonNull Builder newBuilder() {
        return new Builder(this);
    }

    public static class Builder implements Preconditions<Expertise> {

        @Nullable
        Picture badge;

        long value = NO_VALUE;

        public Builder() {
        }

        public Builder(@NonNull Expertise expertise) {
            value(expertise.value());
            badge(expertise.badge());
        }

        public final @NonNull Builder value(final @NonNull long value) {
            this.value = value;
            return this;
        }

        public final @NonNull Builder badge(final @NonNull Picture badge) {
            this.badge = badge;
            return this;
        }

        @Override
        public @NonNull Expertise build() {
            if (buildable())
                return new Expertise(this);
            else throw new IllegalStateException("Builder has an illegal state");
        }

        @Override
        public boolean buildable() {
            boolean buildable = value != NO_VALUE;
            buildable &= badge != null;
            return buildable;
        }
    }

}

@@ -511,44 +511,8 @@
 lue;
-%0A    private @NonNull Picture badge;
 %0A%0A  
@@ -637,105 +637,463 @@
     
+%7D%0A%0A
     
-this.badge = builder.badge;%0A    %7D%0A%0A    public @NonNull Picture badge() %7B%0A        return badge
+public @NonNull String badgeUrl() %7B%0A        //TODO%0A        if (value %3C 50)%0A            return %22img1-%25density%22;%0A        if (value %3C 100)%0A            return %22img2-%25density%22;%0A        if (value %3C 250)%0A            return %22img3-%25density%22;%0A        if (value %3C 500)%0A            return %22img4-%25density%22;%0A        if (value %3C 1000)%0A            return %22img5-%25density%22;%0A        if (value %3C 2500)%0A            return %22img6-%25density%22;%0A        return %22img7-%25density%22
 ;%0A  
@@ -1320,50 +1320,8 @@
  %7B%0A%0A
-        @Nullable%0A        Picture badge;%0A%0A
     
@@ -1483,46 +1483,8 @@
 ));%0A
-            badge(expertise.badge());%0A
     
@@ -1635,152 +1635,8 @@
  %7D%0A%0A
-        public final @NonNull Builder badge(final @NonNull Picture badge) %7B%0A            this.badge = badge;%0A            return this;%0A        %7D%0A%0A
     
@@ -1930,115 +1930,32 @@
     
-boolean buildable = value != NO_VALUE;%0A            buildable &= badge != null;%0A            return buildable
+return value != NO_VALUE
 ;%0A  

Fix expertise model