<commit_before>package org.pm4j.core.pm.impl;

import org.pm4j.core.pm.PmAttrBoolean;
import org.pm4j.core.pm.PmObject;
import org.pm4j.core.pm.PmOptionSet;
import org.pm4j.core.pm.api.PmLocalizeApi;
import org.pm4j.core.pm.impl.converter.PmConverterBoolean;
import org.pm4j.core.pm.impl.options.PmOptionSetImpl;
import org.pm4j.core.pm.impl.options.PmOptionSetUtil;

public class PmAttrBooleanImpl extends PmAttrBase<Boolean, Boolean> implements PmAttrBoolean {

  public PmAttrBooleanImpl(PmObject pmParent) {
    super(pmParent);
  }

  /**
   * Provides a localized according to the current value.
   * <p>
   * Provides the localizations for the keys 'Boolean.TRUE' and 'Boolean.FALSE'.
   */
  @Override
  public String getValueLocalized() {
    Boolean value = getValue();
    return (value != null)
      ? PmLocalizeApi.localizeBooleanValue(this, value)
      : null;
  }

  @Override
  protected PmOptionSet getOptionSetImpl() {
    return new PmOptionSetImpl(PmOptionSetUtil.makeBooleanOptions(this));
  }

  // ======== meta data ======== //

  @Override
  protected PmObjectBase.MetaData makeMetaData() {
    return new MetaData();
  }

  @Override
  protected void initMetaData(PmObjectBase.MetaData metaData) {
    super.initMetaData(metaData);

    ((MetaData) metaData).setConverterDefault(PmConverterBoolean.INSTANCE);
  }

  protected static class MetaData extends PmAttrBase.MetaData {
    @Override<commit_msg>Boolean Attribute: Null option for attributes that actually have a null-value.<commit_after>package org.pm4j.core.pm.impl;

import org.pm4j.core.pm.PmAttrBoolean;
import org.pm4j.core.pm.PmObject;
import org.pm4j.core.pm.PmOptionSet;
import org.pm4j.core.pm.api.PmLocalizeApi;
import org.pm4j.core.pm.impl.converter.PmConverterBoolean;
import org.pm4j.core.pm.impl.options.PmOptionSetImpl;
import org.pm4j.core.pm.impl.options.PmOptionSetUtil;

public class PmAttrBooleanImpl extends PmAttrBase<Boolean, Boolean> implements PmAttrBoolean {

  public PmAttrBooleanImpl(PmObject pmParent) {
    super(pmParent);
  }

  /**
   * Provides a localized according to the current value.
   * <p>
   * Provides the localizations for the keys 'Boolean.TRUE' and 'Boolean.FALSE'.
   */
  @Override
  public String getValueLocalized() {
    Boolean value = getValue();
    return (value != null)
      ? PmLocalizeApi.localizeBooleanValue(this, value)
      : null;
  }

  @Override
  protected PmOptionSet getOptionSetImpl() {
    boolean withNullOption = !isRequired() ||
                             (getValue() == null);
    return new PmOptionSetImpl(PmOptionSetUtil.makeBooleanOptions(this, withNullOption));
  }

  // ======== meta data ======== //

  @Override
  protected PmObjectBase.MetaData makeMetaData() {
    return new MetaData();
  }

  @Override
  protected void initMetaData(PmObjectBase.MetaData metaData) {
    super.initMetaData(metaData);

    ((MetaData) metaData).setConverterDefault(PmConverterBoolean.INSTANCE);
  }

  protected static class MetaData extends PmAttrBase.MetaData {
    @Override
{'fraction_non_alphanumeric': 0.11151315789473684, 'fraction_numerical': 0.005263157894736842, 'mean_word_length': 4.093802345058626, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6815785', 'n_tokens_mistral': 987, 'n_tokens_neox': 980, 'n_words': 195}