001package org.hl7.fhir.utilities.json.model; 002 003public class JsonBoolean extends JsonPrimitive { 004 private boolean value; 005 006 public JsonBoolean(boolean value) { 007 super(); 008 this.value = value; 009 } 010 011 private JsonBoolean() { 012 } 013 014 public JsonElementType type() { 015 return JsonElementType.BOOLEAN; 016 } 017 018 public boolean isValue() { 019 return value; 020 } 021 022 public void setValue(boolean value) { 023 this.value = value; 024 } 025 026 @Override 027 public String getValue() { 028 return value ? "true" : "false"; 029 } 030 031 @Override 032 public String toString() { 033 return getValue(); 034 } 035 036 @Override 037 protected JsonElement copy(JsonElement other) { 038 value = ((JsonBoolean) other).value; 039 return this; 040 } 041 042 @Override 043 protected JsonElement make() { 044 return new JsonBoolean(); 045 } 046}