creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1548674 - in /creadur/rat/branches/gsoc/apache-rat-api/src: main/java/org/apache/rat/api/domain/LicenseFamily.java main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
Date Fri, 06 Dec 2013 19:12:37 GMT
Author: rdonkin
Date: Fri Dec  6 19:12:37 2013
New Revision: 1548674

URL: http://svn.apache.org/r1548674
Log:
License family has a name

Modified:
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
    creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
    creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java?rev=1548674&r1=1548673&r2=1548674&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamily.java
Fri Dec  6 19:12:37 2013
@@ -22,11 +22,14 @@ public final class LicenseFamily {
 
     private final String notes;
     private final String category;
+    private final String name;
 
-    public LicenseFamily(final String notes, final String category) {
+    public LicenseFamily(final String notes, final String category,
+            final String name) {
         super();
         this.notes = notes;
         this.category = category;
+        this.name = name;
     }
 
     public String getNotes() {
@@ -37,4 +40,8 @@ public final class LicenseFamily {
         return this.category;
     }
 
+    public String getName() {
+        return this.name;
+    }
+
 }

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java?rev=1548674&r1=1548673&r2=1548674&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/main/java/org/apache/rat/api/domain/LicenseFamilyBuilder.java
Fri Dec  6 19:12:37 2013
@@ -27,10 +27,9 @@ public final class LicenseFamilyBuilder 
 
     private String notes;
     private String category;
+    private String name;
 
     private LicenseFamilyBuilder() {
-        this.notes = null;
-        this.category = null;
     }
 
     public LicenseFamilyBuilder withNotes(final String notes) {
@@ -39,11 +38,16 @@ public final class LicenseFamilyBuilder 
     }
 
     public LicenseFamily build() {
-        return new LicenseFamily(this.notes, this.category);
+        return new LicenseFamily(this.notes, this.category, this.name);
     }
 
     public LicenseFamilyBuilder withCategory(final String category) {
         this.category = category;
         return this;
     }
+
+    public LicenseFamilyBuilder withName(final String name) {
+        this.name = name;
+        return this;
+    }
 }

Modified: creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java?rev=1548674&r1=1548673&r2=1548674&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-api/src/test/java/org/apache/rat/api/domain/LicenseFamilyBuilderTest.java
Fri Dec  6 19:12:37 2013
@@ -50,4 +50,14 @@ public class LicenseFamilyBuilderTest {
                         .withCategory(someCategory).build();
         assertThat(family.getCategory(), is(someCategory));
     }
+
+    @Test
+    public void testWithName() {
+        final String someName = "A name for a license";
+        final LicenseFamily family =
+                LicenseFamilyBuilder.aLicenseFamily().withName(someName)
+                        .build();
+        assertThat(family.getName(), is(someName));
+
+    }
 }



Mime
View raw message