Record Class ModalSpec
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.app.ui.dialog.ModalSpec
public record ModalSpec(String title, String description, List<ModalSpec.Field> fields, String cta, boolean danger, Consumer<Map<String,String>> onOk, ModalSpec.Suggest suggest)
extends Record
Description of a simple form dialog. The first field receives focus.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne option of aModalSpec.Kind.CHOICEfield: its label, and a line below it that says what it means.static final recordOne field of the form.static enumWhat kind of control a field is.static final recordA button Suggest message under the fieldtargetKey:askgets what is typed in the form so far and answers with the text for the field (or fails with a readable message). -
Constructor Summary
ConstructorsConstructorDescriptionModalSpec(String title, String description, List<ModalSpec.Field> fields, String cta, boolean danger, Consumer<Map<String, String>> onOk) Without a suggestion button.ModalSpec(String title, String description, List<ModalSpec.Field> fields, String cta, boolean danger, Consumer<Map<String, String>> onOk, ModalSpec.Suggest suggest) Creates an instance of aModalSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncta()Returns the value of thectarecord component.booleandanger()Returns the value of thedangerrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.onOk()Returns the value of theonOkrecord component.suggest()Returns the value of thesuggestrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModalSpec
public ModalSpec(String title, String description, List<ModalSpec.Field> fields, String cta, boolean danger, Consumer<Map<String, String>> onOk) Without a suggestion button. -
ModalSpec
public ModalSpec(String title, String description, List<ModalSpec.Field> fields, String cta, boolean danger, Consumer<Map<String, String>> onOk, ModalSpec.Suggest suggest) Creates an instance of aModalSpecrecord class.- Parameters:
title- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentfields- the value for thefieldsrecord componentcta- the value for thectarecord componentdanger- the value for thedangerrecord componentonOk- the value for theonOkrecord componentsuggest- the value for thesuggestrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
cta
Returns the value of thectarecord component.- Returns:
- the value of the
ctarecord component
-
danger
public boolean danger()Returns the value of thedangerrecord component.- Returns:
- the value of the
dangerrecord component
-
onOk
Returns the value of theonOkrecord component.- Returns:
- the value of the
onOkrecord component
-
suggest
Returns the value of thesuggestrecord component.- Returns:
- the value of the
suggestrecord component
-