OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 17 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 180
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.utils.cc;
14
 package org.openconcerto.utils.cc;
15
 
15
 
16
import org.apache.commons.collections.FactoryUtils;
-
 
17
 
-
 
18
public abstract class Factory<E> implements IFactory<E>, ITransformer<Object, E>, org.apache.commons.collections.Factory {
16
public abstract class Factory<E> implements IFactory<E>, ITransformer<Object, E> {
19
 
17
 
20
    public static final <N> IFactory<N> constantFactory(final N constantToReturn) {
18
    public static final <N> IFactory<N> constantFactory(final N constantToReturn) {
21
        return new IFactoryWrapper<N>(FactoryUtils.constantFactory(constantToReturn));
19
        if (constantToReturn == null)
22
    }
-
 
23
 
-
 
24
    @Override
-
 
25
    public final Object create() {
20
            return ConstantFactory.nullFactory();
26
        return this.createChecked();
21
        return new ConstantFactory<N>(constantToReturn);
27
    }
22
    }
28
 
23
 
29
    @Override
24
    @Override
30
    public final E transformChecked(Object input) {
25
    public final E transformChecked(Object input) {
31
        return this.createChecked();
26
        return this.createChecked();