All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.realityforge.replicant.client.Verifiable Maven / Gradle / Ivy

There is a newer version: 5.98-arez-b23
Show newest version
package org.realityforge.replicant.client;

import javax.annotation.Nonnull;

/**
 * Interface implemented by imitations that can verify their state.
 */
public interface Verifiable
{
  /**
   * Check the state of the entity and raise an exception if invalid or any related entities are invalid.
   *
   * @throws Exception if entity invalid.
   */
  void verify()
    throws Exception;

  /**
   * Verify they supplied object if it is verifiable.
   *
   * @param object the object to verify.
   * @throws Exception if entity invalid.
   */
  static void verify( @Nonnull final Object object )
    throws Exception
  {
    if ( object instanceof Verifiable )
    {
      ( (Verifiable) object ).verify();
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy