@Test public void testConvertToProjectProperties1() { prepareJob(); DescribableList<Publisher, Descriptor<Publisher>> list = null; Map<String, ExternalProjectProperty<Publisher>> map = DescribableListUtil.convertToProjectProperties(list, job); assertNotNull(map); assertTrue(map.isEmpty()); }
public static <T extends Describable<T>, D extends Descriptor<T>> Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner) { Map<String, ExternalProjectProperty<T>> result = Maps.newConcurrentMap(); if (null != describableList) { for (Map.Entry<D, T> entry : describableList.toMap().entrySet()) { ExternalProjectProperty<T> property = new ExternalProjectProperty<T>(owner); String key = entry.getKey().getJsonSafeClassName(); property.setKey(key); property.setValue(entry.getValue()); result.put(key, property); } } return result; }
DescribableListUtil { public static <T extends Describable<T>, D extends Descriptor<T>> Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner) { Map<String, ExternalProjectProperty<T>> result = Maps.newConcurrentMap(); if (null != describableList) { for (Map.Entry<D, T> entry : describableList.toMap().entrySet()) { ExternalProjectProperty<T> property = new ExternalProjectProperty<T>(owner); String key = entry.getKey().getJsonSafeClassName(); property.setKey(key); property.setValue(entry.getValue()); result.put(key, property); } } return result; } }
DescribableListUtil { public static <T extends Describable<T>, D extends Descriptor<T>> Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner) { Map<String, ExternalProjectProperty<T>> result = Maps.newConcurrentMap(); if (null != describableList) { for (Map.Entry<D, T> entry : describableList.toMap().entrySet()) { ExternalProjectProperty<T> property = new ExternalProjectProperty<T>(owner); String key = entry.getKey().getJsonSafeClassName(); property.setKey(key); property.setValue(entry.getValue()); result.put(key, property); } } return result; } private  DescribableListUtil(); }
DescribableListUtil { public static <T extends Describable<T>, D extends Descriptor<T>> Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner) { Map<String, ExternalProjectProperty<T>> result = Maps.newConcurrentMap(); if (null != describableList) { for (Map.Entry<D, T> entry : describableList.toMap().entrySet()) { ExternalProjectProperty<T> property = new ExternalProjectProperty<T>(owner); String key = entry.getKey().getJsonSafeClassName(); property.setKey(key); property.setValue(entry.getValue()); result.put(key, property); } } return result; } private  DescribableListUtil(); static DescribableList<T, D> buildFromJson(
        Saveable owner,
        StaplerRequest req,
        JSONObject json,
        List<D> descriptors); static DescribableList<T, D> buildFromHetero(
        Saveable owner,
        StaplerRequest req, JSONObject formData,
        String key,
        Collection<D> descriptors); static Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner); static DescribableList<T, Descriptor<T>> convertToDescribableList(
        List<Descriptor<T>> descriptors, Job owner); @SuppressWarnings("unchecked") static DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass); }
DescribableListUtil { public static <T extends Describable<T>, D extends Descriptor<T>> Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner) { Map<String, ExternalProjectProperty<T>> result = Maps.newConcurrentMap(); if (null != describableList) { for (Map.Entry<D, T> entry : describableList.toMap().entrySet()) { ExternalProjectProperty<T> property = new ExternalProjectProperty<T>(owner); String key = entry.getKey().getJsonSafeClassName(); property.setKey(key); property.setValue(entry.getValue()); result.put(key, property); } } return result; } private  DescribableListUtil(); static DescribableList<T, D> buildFromJson(
        Saveable owner,
        StaplerRequest req,
        JSONObject json,
        List<D> descriptors); static DescribableList<T, D> buildFromHetero(
        Saveable owner,
        StaplerRequest req, JSONObject formData,
        String key,
        Collection<D> descriptors); static Map<String, ExternalProjectProperty<T>> convertToProjectProperties(DescribableList<T, D> describableList, Job owner); static DescribableList<T, Descriptor<T>> convertToDescribableList(
        List<Descriptor<T>> descriptors, Job owner); @SuppressWarnings("unchecked") static DescribableList<T, D> convertToDescribableList(List<D> descriptors, Job owner, Class<P> propertyClass);  }