ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/value/ValueBoolean.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/value/ValueBoolean.java
Status
scanned
Type
file
Name
ValueBoolean.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
2852 (2.8 KB)
MD5
64230ec399f2f7d7776eff1c4384a25d
SHA1
386ef7bda8185f2d5f083c9b655839b7149bded1
SHA256
41fe6b8746b8a8d15518f21a27a30341769f64d696c9a72f983aee2ffe0fe7c8
SHA512

      
    
SHA1_git
5bfaeddef9f788c3ef3c8a2fa2df897369002bb8
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ValueBoolean.java | 2.8 KB |

/* * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.value; import java.math.BigDecimal; import org.h2.engine.CastDataProvider; /** * Implementation of the BOOLEAN data type. */ public final class ValueBoolean extends Value { /** * The precision in digits. */ public static final int PRECISION = 1; /** * The maximum display size of a boolean. * Example: FALSE */ public static final int DISPLAY_SIZE = 5; /** * TRUE value. */ public static final ValueBoolean TRUE = new ValueBoolean(true); /** * FALSE value. */ public static final ValueBoolean FALSE = new ValueBoolean(false); private final boolean value; private ValueBoolean(boolean value) { this.value = value; } @Override public TypeInfo getType() { return TypeInfo.TYPE_BOOLEAN; } @Override public int getValueType() { return BOOLEAN; } @Override public int getMemory() { // Singleton TRUE and FALSE values return 0; } @Override public StringBuilder getSQL(StringBuilder builder, int sqlFlags) { return builder.append(getString()); } @Override public String getString() { return value ? "TRUE" : "FALSE"; } @Override public boolean getBoolean() { return value; } @Override public byte getByte() { return value ? (byte) 1 : (byte) 0; } @Override public short getShort() { return value ? (short) 1 : (short) 0; } @Override public int getInt() { return value ? 1 : 0; } @Override public long getLong() { return value ? 1L : 0L; } @Override public BigDecimal getBigDecimal() { return value ? BigDecimal.ONE : BigDecimal.ZERO; } @Override public float getFloat() { return value ? 1f : 0f; } @Override public double getDouble() { return value ? 1d : 0d; } @Override public Value negate() { return value ? FALSE : TRUE; } @Override public int compareTypeSafe(Value o, CompareMode mode, CastDataProvider provider) { return Boolean.compare(value, ((ValueBoolean) o).value); } @Override public int hashCode() { return value ? 1 : 0; } /** * Get the boolean value for the given boolean. * * @param b the boolean * @return the value */ public static ValueBoolean get(boolean b) { return b ? TRUE : FALSE; } @Override public boolean equals(Object other) { // there are only ever two instances, so the instance must match return this == other; } }
Detected license expression

      
    
Detected license expression (SPDX)

      
    
Percentage of license text
3.74
Copyrights
- end_line: 2
  copyright: Copyright 2004-2023 H2 Group. Multiple-Licensed
  start_line: 2
Holders
- holder: H2 Group. Multiple-Licensed
  end_line: 2
  start_line: 2
Authors

      
    
License expression License clue details
(mpl-2.0 OR epl-1.0) AND proprietary-license {'score': 20.37, 'matcher': '3-seq', 'end_line': 3, 'rule_url': 'https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'from_file': None, 'start_line': 2, 'matched_text': ' * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,\n * and the EPL 1.0 (https://h2database.com/html/license.html).', 'match_coverage': 20.37, 'matched_length': 11, 'rule_relevance': 100, 'rule_identifier': 'mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'license_expression': '(mpl-2.0 OR epl-1.0) AND proprietary-license', 'license_expression_spdx': '(MPL-2.0 OR EPL-1.0) AND LicenseRef-scancode-proprietary-license'}
URL Start line End line
https://h2database.com/html/license.html 3 3
Package URL License Primary language
pkg:osgi/com.h2database.source@2.2.220