= SyncControl _(record)_
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Controls the way that a (synchronous) wrapper works.

== API

[source,java]
.SyncControl.java
----
record SyncControl {
  SyncControl(boolean isSkipRules, boolean isSkipExecute, Can<CommandListener> commandListeners, ExceptionHandler exceptionHandler)
  SyncControl defaults()
  SyncControl withSkipRules()     // <.>
  SyncControl withCheckRules()
  SyncControl withExecute()     // <.>
  SyncControl withNoExecute()     // <.>
  SyncControl listen(CommandListener commandListener)
  SyncControl withExceptionHandler(ExceptionHandler exceptionHandler)     // <.>
  boolean isEquivalent(SyncControl other)     // <.>
}
----

<.> xref:#withSkipRules_[withSkipRules()]
+
--
Skip checking business rules (hide/disable/validate) before executing the underlying property or action
--
<.> xref:#withExecute_[withExecute()]
+
--
Explicitly set the action to be executed.
--
<.> xref:#withNoExecute_[withNoExecute()]
+
--
Explicitly set the action to _not_ be executed, in other words a 'dry run'.
--
<.> xref:#withExceptionHandler_ExceptionHandler[withExceptionHandler(ExceptionHandler)]
+
--
How to handle exceptions if they occur, using the provided xref:refguide:applib:index/services/wrapper/control/ExceptionHandler.adoc[ExceptionHandler] .
--
<.> xref:#isEquivalent_SyncControl[isEquivalent(SyncControl)]

== Members

[#withSkipRules_]
=== withSkipRules()

Skip checking business rules (hide/disable/validate) before executing the underlying property or action

[#withExecute_]
=== withExecute()

Explicitly set the action to be executed.

[#withNoExecute_]
=== withNoExecute()

Explicitly set the action to _not_ be executed, in other words a 'dry run'.

[#withExceptionHandler_ExceptionHandler]
=== withExceptionHandler(ExceptionHandler)

How to handle exceptions if they occur, using the provided xref:refguide:applib:index/services/wrapper/control/ExceptionHandler.adoc[ExceptionHandler] .

The default behaviour is to rethrow the exception.

[#isEquivalent_SyncControl]
=== isEquivalent(SyncControl)
