001// Generated by delombok at Sat Feb 25 17:58:34 UTC 2023 002package io.cui.tools.formatting.template.token; 003 004import io.cui.tools.formatting.template.FormatterSupport; 005import lombok.NonNull; 006 007/** 008 * Simple String token, this token returns always his value on 009 * {@linkplain #substituteAttribute(FormatterSupport)} 010 * 011 * @author Eugen Fischer 012 */ 013public class StringToken implements Token { 014 private static final long serialVersionUID = 6377388001925442782L; 015 @NonNull 016 private final String value; 017 018 /** 019 * returns always stored string value 020 */ 021 @Override 022 public String substituteAttribute(final FormatterSupport content) { 023 return value; 024 } 025 026 @Override 027 public boolean isStringToken() { 028 return true; 029 } 030 031 @java.lang.Override 032 @java.lang.SuppressWarnings("all") 033 @lombok.Generated 034 public java.lang.String toString() { 035 return "StringToken(value=" + this.value + ")"; 036 } 037 038 @java.lang.Override 039 @java.lang.SuppressWarnings("all") 040 @lombok.Generated 041 public boolean equals(final java.lang.Object o) { 042 if (o == this) return true; 043 if (!(o instanceof StringToken)) return false; 044 final StringToken other = (StringToken) o; 045 if (!other.canEqual((java.lang.Object) this)) return false; 046 final java.lang.Object this$value = this.value; 047 final java.lang.Object other$value = other.value; 048 if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false; 049 return true; 050 } 051 052 @java.lang.SuppressWarnings("all") 053 @lombok.Generated 054 protected boolean canEqual(final java.lang.Object other) { 055 return other instanceof StringToken; 056 } 057 058 @java.lang.Override 059 @java.lang.SuppressWarnings("all") 060 @lombok.Generated 061 public int hashCode() { 062 final int PRIME = 59; 063 int result = 1; 064 final java.lang.Object $value = this.value; 065 result = result * PRIME + ($value == null ? 43 : $value.hashCode()); 066 return result; 067 } 068 069 @java.lang.SuppressWarnings("all") 070 @lombok.Generated 071 public StringToken(@NonNull final String value) { 072 if (value == null) { 073 throw new java.lang.NullPointerException("value is marked non-null but is null"); 074 } 075 this.value = value; 076 } 077}