Move delegate property interfaces to a separate file.
This commit is contained in:
@@ -1,46 +1,5 @@
|
|||||||
package kotlin.properties
|
package kotlin.properties
|
||||||
|
|
||||||
/**
|
|
||||||
* Base interface that can be used for implementing property delegates of read-only properties. This is provided only for
|
|
||||||
* convenience; you don't have to extend this interface as long as your property delegate has methods with the same
|
|
||||||
* signatures.
|
|
||||||
* @param R the type of object which owns the delegated property.
|
|
||||||
* @param T the type of the property value.
|
|
||||||
*/
|
|
||||||
public interface ReadOnlyProperty<in R, out T> {
|
|
||||||
/**
|
|
||||||
* Returns the value of the property for the given object.
|
|
||||||
* @param thisRef the object for which the value is requested.
|
|
||||||
* @param desc the metadata for the property.
|
|
||||||
* @return the property value.
|
|
||||||
*/
|
|
||||||
public fun get(thisRef: R, desc: PropertyMetadata): T
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base interface that can be used for implementing property delegates of read-only properties. This is provided only for
|
|
||||||
* convenience; you don't have to extend this interface as long as your property delegate has methods with the same
|
|
||||||
* signatures.
|
|
||||||
* @param R the type of object which owns the delegated property.
|
|
||||||
* @param T the type of the property value.
|
|
||||||
*/
|
|
||||||
public interface ReadWriteProperty<in R, T> {
|
|
||||||
/**
|
|
||||||
* Returns the value of the property for the given object.
|
|
||||||
* @param thisRef the object for which the value is requested.
|
|
||||||
* @param desc the metadata for the property.
|
|
||||||
* @return the property value.
|
|
||||||
*/
|
|
||||||
public fun get(thisRef: R, desc: PropertyMetadata): T
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the property for the given object.
|
|
||||||
* @param thisRef the object for which the value is requested.
|
|
||||||
* @param desc the metadata for the property.
|
|
||||||
* @param value the value to set.
|
|
||||||
*/
|
|
||||||
public fun set(thisRef: R, desc: PropertyMetadata, value: T)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard property delegates.
|
* Standard property delegates.
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package kotlin.properties
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base interface that can be used for implementing property delegates of read-only properties.
|
||||||
|
*
|
||||||
|
* This is provided only for convenience; you don't have to extend this interface
|
||||||
|
* as long as your property delegate has methods with the same signatures.
|
||||||
|
*
|
||||||
|
* @param R the type of object which owns the delegated property.
|
||||||
|
* @param T the type of the property value.
|
||||||
|
*/
|
||||||
|
public interface ReadOnlyProperty<in R, out T> {
|
||||||
|
/**
|
||||||
|
* Returns the value of the property for the given object.
|
||||||
|
* @param thisRef the object for which the value is requested.
|
||||||
|
* @param desc the metadata for the property.
|
||||||
|
* @return the property value.
|
||||||
|
*/
|
||||||
|
public fun get(thisRef: R, desc: PropertyMetadata): T
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base interface that can be used for implementing property delegates of read-write properties.
|
||||||
|
*
|
||||||
|
* This is provided only for convenience; you don't have to extend this interface
|
||||||
|
* as long as your property delegate has methods with the same signatures.
|
||||||
|
*
|
||||||
|
* @param R the type of object which owns the delegated property.
|
||||||
|
* @param T the type of the property value.
|
||||||
|
*/
|
||||||
|
public interface ReadWriteProperty<in R, T> {
|
||||||
|
/**
|
||||||
|
* Returns the value of the property for the given object.
|
||||||
|
* @param thisRef the object for which the value is requested.
|
||||||
|
* @param desc the metadata for the property.
|
||||||
|
* @return the property value.
|
||||||
|
*/
|
||||||
|
public fun get(thisRef: R, desc: PropertyMetadata): T
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the property for the given object.
|
||||||
|
* @param thisRef the object for which the value is requested.
|
||||||
|
* @param desc the metadata for the property.
|
||||||
|
* @param value the value to set.
|
||||||
|
*/
|
||||||
|
public fun set(thisRef: R, desc: PropertyMetadata, value: T)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user