001/* 002 * ============================================================================ 003 * Copyright © 2002-2021 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.config.ap.impl; 019 020import static org.apiguardian.api.API.Status.STABLE; 021 022import java.util.EnumSet; 023import java.util.Optional; 024import java.util.function.BiFunction; 025 026import org.apiguardian.api.API; 027import org.tquadrat.foundation.annotation.ClassVersion; 028import org.tquadrat.foundation.config.ap.PropertySpec; 029import org.tquadrat.foundation.javacomposer.CodeBlock; 030import org.tquadrat.foundation.javacomposer.FieldSpec; 031import org.tquadrat.foundation.javacomposer.MethodSpec; 032 033/** 034 * The specification for special properties. 035 * 036 * @version $Id: SpecialPropertySpec.java 1001 2022-01-29 16:42:15Z tquadrat $ 037 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 038 * @UMLGraph.link 039 * @since 0.1.0 040 */ 041@ClassVersion( sourceVersion = "$Id: SpecialPropertySpec.java 1001 2022-01-29 16:42:15Z tquadrat $" ) 042@API( status = STABLE, since = "0.1.0" ) 043public interface SpecialPropertySpec extends PropertySpec 044{ 045 /*---------*\ 046 ====** Methods **========================================================== 047 \*---------*/ 048 /** 049 * Returns the method that composes the 'add' method for the property. 050 * 051 * @return An instance of 052 * {@link Optional} 053 * that holds the 'add' method composer. 054 */ 055 public Optional<BiFunction<CodeBuilder,PropertySpecImpl,MethodSpec>> getAddMethodComposer(); 056 057 /** 058 * Returns all the flags that were set for this special property 059 * specification. 060 * 061 * @return The flags. 062 */ 063 public EnumSet<PropertyFlag> getAllFlags(); 064 065 /** 066 * Returns the method that composes the constructor fragment for the 067 * initialisation of the property. 068 * 069 * @return An instance of 070 * {@link Optional} 071 * that holds the composer for the constructor fragment. 072 */ 073 public Optional<BiFunction<CodeBuilder,PropertySpecImpl, CodeBlock>> getConstructorFragmentComposer(); 074 075 /** 076 * Returns the method that composes the field for the property. 077 * 078 * @return An instance of 079 * {@link Optional} 080 * that holds the field composer. 081 */ 082 public Optional<BiFunction<CodeBuilder,PropertySpecImpl,FieldSpec>> getFieldComposer(); 083 084 /** 085 * Returns the method that composes the getter for the property. 086 * 087 * @return An instance of 088 * {@link Optional} 089 * that holds the getter composer. 090 */ 091 public Optional<BiFunction<CodeBuilder,PropertySpecImpl,MethodSpec>> getGetterComposer(); 092 093 /** 094 * Returns the method that composes the setter for the property. 095 * 096 * @return An instance of 097 * {@link Optional} 098 * that holds the setter composer. 099 */ 100 public Optional<BiFunction<CodeBuilder,PropertySpecImpl,MethodSpec>> getSetterComposer(); 101} 102// interface SpecialPropertySpec 103 104/* 105 * End of File 106 */