Search in sources :

Example 1 with CaseInsensitiveIData

use of permafrost.tundra.data.CaseInsensitiveIData in project Tundra by Permafrost.

the class document method uncase.

public static final void uncase(IData pipeline) throws ServiceException {
    // --- <<IS-START(uncase)>> ---
    // @subtype unknown
    // @sigtype java 3.5
    // [i] record:0:optional $document
    // [i] record:0:optional $locale
    // [i] - field:0:required language
    // [i] - field:0:optional country
    // [i] - field:0:optional variant
    // [o] record:0:optional $document
    IDataCursor cursor = pipeline.getCursor();
    try {
        IData document = IDataHelper.get(cursor, "$document", IData.class);
        Locale locale = IDataHelper.getOrDefault(cursor, "$locale", Locale.class, Locale.getDefault());
        if (document != null)
            IDataHelper.put(cursor, "$document", new CaseInsensitiveIData(IDataHelper.duplicate(document, true), locale));
    } finally {
        cursor.destroy();
    }
// --- <<IS-END>> ---
}
Also used : Locale(java.util.Locale) CaseInsensitiveIData(permafrost.tundra.data.CaseInsensitiveIData) CaseInsensitiveIData(permafrost.tundra.data.CaseInsensitiveIData) ImmutableIData(permafrost.tundra.data.ImmutableIData)

Aggregations

Locale (java.util.Locale)1 CaseInsensitiveIData (permafrost.tundra.data.CaseInsensitiveIData)1 ImmutableIData (permafrost.tundra.data.ImmutableIData)1