001/*- 002 * #%L 003 * Smile CDR - CDR 004 * %% 005 * Copyright (C) 2016 - 2024 Smile CDR, Inc. 006 * %% 007 * All rights reserved. 008 * #L% 009 */ 010package ca.cdr.api.security.permission; 011 012import jakarta.annotation.Nonnull; 013 014/** 015 * Base for concrete format types. 016 * Treat as a marker interface, but we can't provide a default toString() on an interface. 017 */ 018public abstract class PermissionArgumentValue implements PermissionArgumentFormat.IPermissionComponent { 019 020 /** 021 * Reverse of parsing. 022 * Get the string version of this permission. 023 * @return empty string for no value 024 */ 025 @Nonnull 026 abstract String getStringValue(); 027 028 /** 029 * Normally the formatted version of this permission argument. 030 */ 031 @Override 032 public String toString() { 033 return getStringValue(); 034 } 035}