package com.zenika.cudf.model;

/**
 * @author Antoine Rouaze <antoine.rouaze@zenika.com>
 */
public class BinaryId {

    private final String name;
    private final String organisation;
    private final int version;

    public BinaryId(String name, String organisation, int version) {
        this.name = name;
        this.organisation = organisation;
        this.version = version;
    }

    public String getName() {
        return name;
    }

    public String getOrganisation() {
        return organisation;
    }

    public int getVersion() {
        return version;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BinaryId binaryId = (BinaryId) o;

        if (version != binaryId.version) return false;
        if (!name.equals(binaryId.name)) return false;
        if (!organisation.equals(binaryId.organisation)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name.hashCode();
        result = 31 * result + organisation.hashCode();
        result = 31 * result + version;
        return result;
    }
}

@@ -295,99 +295,375 @@
     
-this.name = name;%0A        this.organisation = organisation;%0A        this.version = version;
+check(name, %22The name must be not null%22);%0A        check(organisation, %22The organisation must be not null%22);%0A        this.name = name;%0A        this.organisation = organisation;%0A        this.version = version;%0A    %7D%0A%0A    private void check(String string, String message) %7B%0A        if (string == null) %7B%0A            throw new IllegalArgumentException(message);%0A        %7D
 %0A   
@@ -933,16 +933,30 @@
 is == o)
+ %7B%0A           
  return 
@@ -957,24 +957,34 @@
 eturn true;%0A
+        %7D%0A
         if (
@@ -1023,16 +1023,30 @@
 Class())
+ %7B%0A           
  return 
@@ -1043,32 +1043,42 @@
    return false;
+%0A        %7D
 %0A%0A        Binary
@@ -1146,16 +1146,30 @@
 version)
+ %7B%0A           
  return 
@@ -1167,32 +1167,42 @@
   return false;%0A
+        %7D%0A
         if (!nam
@@ -1225,16 +1225,30 @@
 d.name))
+ %7B%0A           
  return 
@@ -1246,32 +1246,42 @@
   return false;%0A
+        %7D%0A
         if (!org
@@ -1320,16 +1320,30 @@
 sation))
+ %7B%0A           
  return 
@@ -1348,16 +1348,26 @@
 n false;
+%0A        %7D
 %0A%0A      

Add validation in BinaryId.