Private methods which do not touch object state can be made static.
Change-Id: I4f5a7e6215c7570660ee797f4e694745844f72e7
Signed-off-by: Robert Varga <rovarga@cisco.com>
return updated;
}
- private ArrayList<String> getSortedKeysByDatastoreType(Collection<String> inKeys,
+ private static ArrayList<String> getSortedKeysByDatastoreType(Collection<String> inKeys,
final String dataStoreTypePrefix) {
// Sort the property keys by putting the names prefixed with the data store type last. This
// is done so data store specific settings are applied after global settings.
}
}
- private Collection<String> getCandidateNames(MapEntryNode entity) {
+ private static Collection<String> getCandidateNames(MapEntryNode entity) {
Collection<MapEntryNode> candidates = ((MapNode) entity.getChild(CANDIDATE_NODE_ID).get()).getValue();
Collection<String> candidateNames = new ArrayList<>(candidates.size());
for(MapEntryNode candidate: candidates) {
followerTestKit.doCommit(rwTx.ready());
}
- private void sendDatastoreContextUpdate(DistributedDataStore dataStore, final Builder builder) {
+ private static void sendDatastoreContextUpdate(DistributedDataStore dataStore, final Builder builder) {
DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class);
Answer<DatastoreContext> answer = new Answer<DatastoreContext>() {
@Override
}
- private void assertStatistics(Map<String, Map<String, Long>> statistics, String memberName, long val) {
+ private static void assertStatistics(Map<String, Map<String, Long>> statistics, String memberName, long val) {
assertEquals(val, statistics.get(ENTITY_TYPE).get(memberName).longValue());
}
}
- private Map<String, Long> prepareStatistics(long... count){
+ private static Map<String, Long> prepareStatistics(long... count){
Map<String, Long> statistics = new HashMap<>();
for(int i=0;i<count.length;i++){
statistics.put("member-" + (i+1), count[i]);
return statistics;
}
- private Collection<String> prepareViableCandidates(int count){
+ private static Collection<String> prepareViableCandidates(int count){
Collection<String> viableCandidates = new ArrayList<>();
for(int i=0;i<count;i++){
viableCandidates.add("member-" + (i+1));