All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.taskadapter.redmineapi.bean.PropertyStorageUtil Maven / Gradle / Ivy

Go to download

Free open-source Java API for Redmine and Chiliproject bug/task management systems. This project was originally a part of Task Adapter application (http://www.taskadapter.com) and then was open-sourced.

The newest version!
package com.taskadapter.redmineapi.bean;

import com.taskadapter.redmineapi.internal.Transport;

import java.util.Collection;

public class PropertyStorageUtil {
    /**
     * go over all properties in the storage and set `transport` on FluentStyle instances inside collections, if any.
     * only process one level, without recursion - to avoid potential cycles and such.
     */
    public static void updateCollections(PropertyStorage storage, Transport transport) {
        storage.getProperties().forEach(e -> {
            if (Collection.class.isAssignableFrom(e.getKey().getType())) {
                // found a collection in properties
                ((Collection) e.getValue()).forEach(i -> {
                    if (i instanceof FluentStyle) {
                        ((FluentStyle) i).setTransport(transport);
                    }
                });

            }

        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy