<commit_before>/*
 * Ujo4GXT - GXT module for the UJO Framework
 * Copyright(c) 2010 <NAME>
 * License: GNU/GPL v3 (see detail on http://www.gnu.org/licenses/gpl.html).
 *          If you need a commercial license, please contact <EMAIL>.
 * Support: <EMAIL> - for both technical or business information
 */

package org.ujoframework.gxt.client;

import java.io.Serializable;

/**
 * Property meta-data
 * @author <NAME>
 */
public class PropertyMetadata implements Serializable {

    private boolean primaryKey;
    private boolean mandatory;
    private int maxLength;
    private int precision;
    //
    private String columnLabel;
    private String sideLabel;
    private String description;

    protected PropertyMetadata() {
    }

    public PropertyMetadata
        ( boolean primaryKey
        , boolean mandatory
        , int maxLength
        , int precision
        , String columnLabel
        , String sideLabel
        , String description
        ){
        this.primaryKey = primaryKey;
        this.mandatory = mandatory;
        this.maxLength = maxLength;
        this.precision = precision;
        this.columnLabel = columnLabel;
        this.sideLabel = sideLabel;
        this.description = isValid(description) ? description : null;
    }

    /** Default constructor. */
    public PropertyMetadata(CujoProperty property) {
        this.primaryKey = false;
        this.mandatory = false;
        this.maxLength = Integer.MAX_VALUE;
        this.precision = 0;
        this.columnLabel = property.getCammelName();
        this.sideLabel = columnLabel;
        this.description = isValid(columnLabel) ? columnLabel : null;
    }

    static private boolean isValid(CharSequence text) {
        return text!=null && text.length()>0;
    }

    public String getColumnLabel() {
        return columnLabel;
    }

    public String getDescription() {
        return description;
    }

    public boolean isMandatory() {
        return mandatory;
    }

    public int getMaxLength() {
        return maxLength;
    }

    public int getMaxLengthExt() {
        return hasMaxLength() ? maxLength : Integer.MAX_VALUE ;<commit_msg>Property Meta Model - sortable attribute<commit_after>/*
 * Ujo4GXT - GXT module for the UJO Framework
 * Copyright(c) 2010 <NAME>
 * License: GNU/GPL v3 (see detail on http://www.gnu.org/licenses/gpl.html).
 *          If you need a commercial license, please contact <EMAIL>.
 * Support: <EMAIL> - for both technical or business information
 */

package org.ujoframework.gxt.client;

import java.io.Serializable;

/**
 * Property meta-data
 * @author <NAME>
 */
public class PropertyMetadata implements Serializable {

    private boolean primaryKey;
    private boolean mandatory;
    private boolean sortable;
    private int maxLength;
    private int precision;
    //
    private String columnLabel;
    private String sideLabel;
    private String description;

    protected PropertyMetadata() {
    }

    public PropertyMetadata
        ( boolean primaryKey
        , boolean mandatory
        , boolean sortable
        , int maxLength
        , int precision
        , String columnLabel
        , String sideLabel
        , String description
        ){
        this.primaryKey = primaryKey;
        this.mandatory = mandatory;
        this.sortable = sortable;
        this.maxLength = maxLength;
        this.precision = precision;
        this.columnLabel = columnLabel;
        this.sideLabel = sideLabel;
        this.description = isValid(description) ? description : null;
    }

    /** Default constructor. */
    public PropertyMetadata(CujoProperty property) {
        this.primaryKey = false;
        this.mandatory = false;
        this.sortable = false;
        this.maxLength = Integer.MAX_VALUE;
        this.precision = 0;
        this.columnLabel = property.getCammelName();
        this.sideLabel = columnLabel;
        this.description = isValid(columnLabel) ? columnLabel : null;
    }

    static private boolean isValid(CharSequence text) {
        return text!=null && text.length()>0;
    }

    public String getColumnLabel() {
        return columnLabel;
    }

    public String getDescription() {
        return description;
    }

    public boolean isMandatory() {
        return mandatory;
    }

    public boolean isSortable() {
        return sortable;
    }

    public int getMaxLength() {
        return maxLength;
    }

    public int getMaxLengthExt() {
        return hasMaxLength() ? maxLength : Integer.MAX_VALUE ;
{'fraction_non_alphanumeric': 0.08522852726871274, 'fraction_numerical': 0.0035327886950761757, 'mean_word_length': 2.429220287660863, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6651880', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1176, 'n_words': 336}