Search in sources :

Example 26 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class CreditCardValidatorMeta method getFields.

public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    String realresultfieldname = space.environmentSubstitute(resultfieldname);
    if (!Utils.isEmpty(realresultfieldname)) {
        ValueMetaInterface v = new ValueMetaBoolean(realresultfieldname);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
    String realcardtype = space.environmentSubstitute(cardtype);
    if (!Utils.isEmpty(realcardtype)) {
        ValueMetaInterface v = new ValueMetaString(realcardtype);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
    String realnotvalidmsg = space.environmentSubstitute(notvalidmsg);
    if (!Utils.isEmpty(notvalidmsg)) {
        ValueMetaInterface v = new ValueMetaString(realnotvalidmsg);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 27 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class DetectLastRowMeta method getFields.

public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (!Utils.isEmpty(resultfieldname)) {
        ValueMetaInterface v = new ValueMetaBoolean(space.environmentSubstitute(resultfieldname));
        v.setOrigin(name);
        row.addValueMeta(v);
    }
}
Also used : ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 28 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class MemoryGroupByMetaTest method getInputRowMeta.

private RowMetaInterface getInputRowMeta() {
    RowMetaInterface rm = new RowMeta();
    rm.addValueMeta(new ValueMetaString("myGroupField2"));
    rm.addValueMeta(new ValueMetaString("myGroupField1"));
    rm.addValueMeta(new ValueMetaString("myString"));
    rm.addValueMeta(new ValueMetaInteger("myInteger"));
    rm.addValueMeta(new ValueMetaNumber("myNumber"));
    rm.addValueMeta(new ValueMetaBigNumber("myBigNumber"));
    rm.addValueMeta(new ValueMetaBinary("myBinary"));
    rm.addValueMeta(new ValueMetaBoolean("myBoolean"));
    rm.addValueMeta(new ValueMetaDate("myDate"));
    rm.addValueMeta(new ValueMetaTimestamp("myTimestamp"));
    rm.addValueMeta(new ValueMetaInternetAddress("myInternetAddress"));
    return rm;
}
Also used : ValueMetaBinary(org.pentaho.di.core.row.value.ValueMetaBinary) ValueMetaTimestamp(org.pentaho.di.core.row.value.ValueMetaTimestamp) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) ValueMetaInternetAddress(org.pentaho.di.core.row.value.ValueMetaInternetAddress) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate)

Example 29 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class SpeedTest method populateMetaAndData.

private static void populateMetaAndData(int i, Object[] rowString10, RowMetaInterface metaString10, Object[] rowMixed10, RowMetaInterface metaMixed10) {
    rowString10[i] = StringUtil.generateRandomString(20, "", "", false);
    ValueMetaInterface meta = new ValueMetaString("String" + (i + 1), 20, 0);
    metaString10.addValueMeta(meta);
    rowMixed10[i * 5 + 0] = StringUtil.generateRandomString(20, "", "", false);
    ValueMetaInterface meta0 = new ValueMetaString("String" + (i * 5 + 1), 20, 0);
    metaMixed10.addValueMeta(meta0);
    rowMixed10[i * 5 + 1] = new Date();
    ValueMetaInterface meta1 = new ValueMetaDate("String" + (i * 5 + 1));
    metaMixed10.addValueMeta(meta1);
    rowMixed10[i * 5 + 2] = new Double(Math.random() * 1000000);
    ValueMetaInterface meta2 = new ValueMetaNumber("String" + (i * 5 + 1), 12, 4);
    metaMixed10.addValueMeta(meta2);
    rowMixed10[i * 5 + 3] = new Long((long) (Math.random() * 1000000));
    ValueMetaInterface meta3 = new ValueMetaInteger("String" + (i * 5 + 1), 8, 0);
    metaMixed10.addValueMeta(meta3);
    rowMixed10[i * 5 + 4] = Boolean.valueOf(Math.random() > 0.5 ? true : false);
    ValueMetaInterface meta4 = new ValueMetaBoolean("String" + (i * 5 + 1));
    metaMixed10.addValueMeta(meta4);
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) Date(java.util.Date) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate)

Example 30 with ValueMetaBoolean

use of org.pentaho.di.core.row.value.ValueMetaBoolean in project pentaho-kettle by pentaho.

the class CloneRowMeta method getFields.

public void getFields(RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    // Output field (boolean) ?
    if (addcloneflag) {
        String realfieldValue = space.environmentSubstitute(cloneflagfield);
        if (!Utils.isEmpty(realfieldValue)) {
            ValueMetaInterface v = new ValueMetaBoolean(realfieldValue);
            v.setOrigin(origin);
            rowMeta.addValueMeta(v);
        }
    }
    // Output clone row number
    if (addclonenum) {
        String realfieldValue = space.environmentSubstitute(clonenumfield);
        if (!Utils.isEmpty(realfieldValue)) {
            ValueMetaInterface v = new ValueMetaInteger(realfieldValue);
            v.setOrigin(origin);
            rowMeta.addValueMeta(v);
        }
    }
}
Also used : ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)84 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)68 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)60 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)46 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)44 ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)32 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)25 RowMeta (org.pentaho.di.core.row.RowMeta)22 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)20 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)20 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)18 Test (org.junit.Test)16 ValueMetaInternetAddress (org.pentaho.di.core.row.value.ValueMetaInternetAddress)15 KettleException (org.pentaho.di.core.exception.KettleException)13 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)13 ObjectId (org.pentaho.di.repository.ObjectId)12 LongObjectId (org.pentaho.di.repository.LongObjectId)9 KettleStepException (org.pentaho.di.core.exception.KettleStepException)8 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)7 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)6