amazon-ion / ion-java-benchmark-cli

Apache License 2.0
7 stars 9 forks source link

Support user-defined types for type constraint. #35

Open linlin-s opened 2 years ago

linlin-s commented 2 years ago
    /**
     * Get the value of constraint 'type' in IonType format.
     * @return the value of 'type' in IonType format.
     */
    public IonType getIonType() {
        return IonType.valueOf(getIsl().get(KEYWORD_TYPE).toString().toUpperCase());
    }

This method only work when the provided constraint type is one of core types. If the provided type is user-defined, this method won't work. And we need to look up the type definition by using method Schema#getType(String name) .

Referred comments: