// Path: src/main/java/org/epics/ca/data/Metadata.java
// public class Metadata<T> extends Data<T>
// {
// }


import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import org.epics.ca.data.Metadata;
package org.epics.ca;




public interface Channel<T> extends AutoCloseable
{
   String getName();

   ConnectionState getConnectionState();

   AccessRights getAccessRights();

   Channel<T> connect();

   CompletableFuture<Channel<T>> connectAsync();


   //
   // listeners
   //

   Listener addConnectionListener( BiConsumer<Channel<T>, Boolean> handler );

   Listener addAccessRightListener( BiConsumer<Channel<T>, AccessRights> handler );


   //
   // sync methods, exception is thrown on failure
   //

   // NOTE: reusable get methods
   //	T get(T reuse);
   // CompletableFuture<T> getAsync(T reuse);
   // <MT extends Metadata<T>> MT get(Class<? extends Metadata> clazz, T reuse);
   // <MT extends Metadata<T>> CompletableFuture<MT> getAsync(Class<? extends MT> clazz, T reuse);

   T get();

   void put( T value );

   void putNoWait( T value ); // best-effort put

   //
   // async methods, exception is reported via CompletableFuture
   //
   CompletableFuture<T> getAsync();

   CompletableFuture<Status> putAsync( T value );

   // NOTE: "public <MT extends Metadata<T>> MT get(Class<MT> clazz)" would
   // be a better definition, however it raises unchecked warnings in the code
   // and requires explicit casts for monitor APIs
   // the drawback of the signature below is that type of "?" can be different than "MT"
   // (it will raise ClassCastException if not properly used)

   @SuppressWarnings( "rawtypes" )
// Path: src/main/java/org/epics/ca/data/Metadata.java
// public class Metadata<T> extends Data<T>
// {
// }


// Path: src/main/java/org/epics/ca/Channel.java
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import org.epics.ca.data.Metadata;

package org.epics.ca;




public interface Channel<T> extends AutoCloseable
{
   String getName();

   ConnectionState getConnectionState();

   AccessRights getAccessRights();

   Channel<T> connect();

   CompletableFuture<Channel<T>> connectAsync();


   //
   // listeners
   //

   Listener addConnectionListener( BiConsumer<Channel<T>, Boolean> handler );

   Listener addAccessRightListener( BiConsumer<Channel<T>, AccessRights> handler );


   //
   // sync methods, exception is thrown on failure
   //

   // NOTE: reusable get methods
   //	T get(T reuse);
   // CompletableFuture<T> getAsync(T reuse);
   // <MT extends Metadata<T>> MT get(Class<? extends Metadata> clazz, T reuse);
   // <MT extends Metadata<T>> CompletableFuture<MT> getAsync(Class<? extends MT> clazz, T reuse);

   T get();

   void put( T value );

   void putNoWait( T value ); // best-effort put

   //
   // async methods, exception is reported via CompletableFuture
   //
   CompletableFuture<T> getAsync();

   CompletableFuture<Status> putAsync( T value );

   // NOTE: "public <MT extends Metadata<T>> MT get(Class<MT> clazz)" would
   // be a better definition, however it raises unchecked warnings in the code
   // and requires explicit casts for monitor APIs
   // the drawback of the signature below is that type of "?" can be different than "MT"
   // (it will raise ClassCastException if not properly used)

   @SuppressWarnings( "rawtypes" )
   <MT extends Metadata<T>> MT get( Class<? extends Metadata> clazz );