-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address Code Review - Method refactor, Class rename, Builder pattern
- Loading branch information
1 parent
1e8560b
commit 0726e4c
Showing
7 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
29 changes: 23 additions & 6 deletions
29
src/main/java/org/cbioportal/model/SampleClinicalDataCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
package org.cbioportal.model; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class SampleClinicalDataCollection { | ||
public final class SampleClinicalDataCollection { | ||
|
||
private final Map<String, List<ClinicalData>> byUniqueSampleKey; | ||
|
||
private SampleClinicalDataCollection(Builder builder) { | ||
this.byUniqueSampleKey = Collections.unmodifiableMap(new HashMap<>(builder.byUniqueSampleKey)); | ||
} | ||
|
||
private Map<String, List<ClinicalData>> byUniqueSampleKey = new HashMap<>(); | ||
|
||
public Map<String, List<ClinicalData>> getByUniqueSampleKey() { | ||
return byUniqueSampleKey; | ||
} | ||
|
||
public void setByUniqueSampleKey(Map<String, List<ClinicalData>> byUniqueSampleKey) { | ||
this.byUniqueSampleKey = byUniqueSampleKey; | ||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
private final Map<String, List<ClinicalData>> byUniqueSampleKey = new HashMap<>(); | ||
|
||
public Builder withByUniqueSampleKey(Map<String, List<ClinicalData>> byUniqueSampleKey) { | ||
this.byUniqueSampleKey.putAll(byUniqueSampleKey); | ||
return this; | ||
} | ||
|
||
public SampleClinicalDataCollection build() { | ||
return new SampleClinicalDataCollection(this); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters