Skip to main content
summaryrefslogtreecommitdiffstats
blob: 10daf1a61a221d37a33e549c323b029130cfd066 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.eclipse.xtend.backend.functions.java;

import org.eclipse.xtend.backend.common.EfficientLazyString;


/**
 * This class is provided to allow Java methods to deal with EfficientLazyString without
 *  the performance penalty of conversion to String and without forcing them to deal with
 *  conversion and special cases.
 */
class EfficientLazyStringConverter implements JavaBuiltinConverter {

    public Object backendToJava (Object o) {
        if (o == null)
            return null;
        
        final EfficientLazyString result = new EfficientLazyString ();
        result.append (o);
        return result;
    }

    public Object javaToBackend (Object o) {
        return o;
    }
}

Back to the top