text:
package com.flipkart.hbaseobjectmapper;

import com.flipkart.hbaseobjectmapper.codec.Codec;
import com.flipkart.hbaseobjectmapper.exceptions.InvalidReadVersionsCountException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.AdvancedScanResultConsumer;
import org.apache.hadoop.hbase.client.Append;
import org.apache.hadoop.hbase.client.AsyncConnection;
import org.apache.hadoop.hbase.client.AsyncTable;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Increment;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.Serializable;
import java.io.UncheckedIOException;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * A reactive Data Access Object (DAO) class that enables simple random access (read/write) of HBase rows.
 * This implementation aims to be capability conformant with {@link AbstractHBDAO}.
 *
 * @param <R> Data type of row key, which should be '{@link Comparable} with itself' and must be {@link Serializable} (e.g. {@link String}, {@link Integer}, {@link BigDecimal} etc. or your own POJO)
 * @param <T> Entity type that maps to an HBase row (this type must have implemented {@link HBRecord} interface)
 */
public abstract class ReactiveHBDAO<R extends Serializable & Comparable<R>, T extends HBRecord<R>> extends BaseHBDAO<R, T> {

    protected final AsyncConnection connection;

    /**
     * Constructs a data access object using your custom {@link HBObjectMapper}.
     *

     *

     * Note: If you want to use the default {@link HBObjectMapper}, just use the constructor {@link #ReactiveHBDAO(AsyncConnection)} (AsyncConnection)}
     *
     * @param connection     HBase Connection
     * @param hbObjectMapper Your custom {@link HBObjectMapper}
     * @throws IllegalStateException Annotation(s) on base entity may be incorrect
     */
    protected ReactiveHBDAO(@Nonnull final AsyncConnection connection, @Nonnull final HBObjectMapper hbObjectMapper) {
        super(hbObjectMapper);
        this.connection = connection;
    }

    /**
     * Constructs a data access object using your custom {@link HBObjectMapper}.
     *

     *

     * Note: If you want to use the default {@link HBObjectMapper}, just use the constructor {@link #ReactiveHBDAO(Configuration)}
     *
     * @param configuration  Hadoop configuration
     * @param hbObjectMapper Your custom {@link HBObjectMapper}
     * @throws IllegalStateException Annotation(s) on base entity may be incorrect
     */
    protected ReactiveHBDAO(@Nonnull final Configuration configuration, @Nonnull final HBObjectMapper hbObjectMapper) {
        this(ConnectionFactory.createAsyncConnection(configuration).join(), hbObjectMapper);
    }

    /**
     * Constructs a data access object using your custom codec.
     *

     *

     * Note: If you want to use the default codec, just use the constructor {@link #ReactiveHBDAO(AsyncConnection)}
     *
     * @param connection HBase Connection
     * @param codec      Your custom codec. If null, default codec is used.
     * @throws IllegalStateException Annotation(s) on base entity may be incorrect
     */
    protected ReactiveHBDAO(@Nonnull final AsyncConnection connection, @Nonnull final Codec codec) {
        this(connection, HBObjectMapperFactory.construct(codec));
    }

    /**
     * Constructs a data access object using your custom codec.
     *

     *

     * Note: If you want to use the default codec, just use the constructor {@link #ReactiveHBDAO(Configuration)}
     *
     * @param configuration Hadoop configuration
     * @param codec         Your custom codec. If null, default codec is used.
     * @throws IllegalStateException Annotation(s) on base entity may be incorrect
     */
    protected ReactiveHBDAO(@Nonnull final Configuration configuration, @Nonnull final Codec codec) {
        this(ConnectionFactory.createAsyncConnection(configuration).join(), HBObjectMapperFactory.construct(codec));
    }

    /**
     * Constructs a data access object.
     *
     * @param connection HBase Connection
     * @throws IllegalStateException Annotation(s) on base entity may be incorrect
     */
    protected ReactiveHBDAO(@Nonnull final AsyncConnection connection) {
        this(connection, HBObjectMapperFactory.construct());
    }

    /**
     * Constructs a data access object.
     *
     * @param configuration Hadoop configuration
     * @throws IllegalStateException Annotation(s) on base entity may be incorrect
     */
    protected ReactiveHBDAO(@Nonnull final Configuration configuration) {
        this(configuration, HBObjectMapperFactory.construct());
    }

    /**
     * Get specified number of versions of a row from HBase table by it's row key
     *
     * @param rowKey             Row key
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return HBase row, deserialized as object of your bean-like class (that implements {@link HBRecord})
     */
    public CompletableFuture<T> get(@Nonnull final R rowKey, final int numVersionsToFetch) {

        final Get get = getGet(rowKey, numVersionsToFetch);
        return getHBaseTable()
                .get(get)
                .thenApply(mapResultToRecordType());
    }

    /**
     * Get a row from HBase table by it's row key
     *
     * @param rowKey Row key
     * @return HBase row, deserialized as object of your bean-like class (that implements {@link HBRecord})
     */
    public CompletableFuture<T> get(@Nonnull final R rowKey) {
        return get(rowKey, 1);
    }

    /**
     * Fetch an HBase row for a given {@link Get} object
     *
     * @param get HBase's Get object, typically formed using the {@link #getGet(Serializable) getGet(R)} method
     * @return HBase row, deserialized as object of your bean-like class (that implements {@link HBRecord})
     */
    public CompletableFuture<T> getOnGet(@Nonnull final Get get) {

        return getHBaseTable()
                .get(get)
                .thenApply(mapResultToRecordType());
    }

    /**
     * @param gets List of {@link Get} objects for which rows have to be fetched
     * @return List of rows corresponding to row keys passed, deserialized as objects of your bean-like class
     */
    @SuppressWarnings("unused")
    public Stream<CompletableFuture<T>> getOnGets(@Nonnull final List<Get> gets) {

        return getHBaseTable()
                .get(gets)
                .stream()
                .map(resultCompletableFuture -> resultCompletableFuture.thenApply(mapResultToRecordType()));
    }

    /**
     * Get specified number of versions of rows from HBase table by array of row keys (This method is a bulk variant of {@link #get(Serializable, int) get(R, int)} method)
     *
     * @param rowKeys            Row keys to fetch
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return Array of HBase rows, deserialized as object of your bean-like class (that implements {@link HBRecord})
     */
    public Stream<CompletableFuture<T>> get(@Nonnull final R[] rowKeys, int numVersionsToFetch) {

        final List<Get> gets = new ArrayList<>(rowKeys.length);
        for (final R rowKey : rowKeys) {
            gets.add(getGet(rowKey, numVersionsToFetch));
        }

        return getOnGets(gets);
    }

    /**
     * Get records by array of row keys (This method is a bulk variant of {@link #get(Serializable) get(R)} method)
     *
     * @param rowKeys Row keys to fetch
     * @return Array of HBase rows, deserialized as object of your bean-like class (that implements {@link HBRecord})
     */
    public Stream<CompletableFuture<T>> get(@Nonnull final R[] rowKeys) {
        return get(rowKeys, 1);
    }

    /**
     * Get specified number of versions of rows from HBase table by a range of row keys - start key (inclusive) to end key (exclusive)
     *

     * This method is a multi-version variant of {@link #get(Serializable, Serializable) get(R, R)}
     *

     * Caution: If you expect large number or rows for given start and end row keys, do not use this method. Use the iterable variant {@link #records(Serializable, boolean, Serializable, boolean, int, int) records(R, boolean, R, boolean, int, int)} instead.
     *
     * @param startRowKey        Row start
     * @param endRowKey          Row end
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return List of rows corresponding to row keys passed, deserialized as objects of your bean-like class
     */
    public CompletableFuture<List<T>> get(@Nonnull final R startRowKey, @Nonnull final R endRowKey, int numVersionsToFetch) {
        return get(startRowKey, true, endRowKey, false, numVersionsToFetch);
    }

    /**
     * Get specified number of versions of rows from HBase table by a range of row keys - start key (inclusive) to end key (exclusive)
     *

     * Caution: If you expect large number or rows for given start and end row keys, do not use this method. Use the iterable variant {@link #records(Serializable, boolean, Serializable, boolean, int, int) records(R, boolean, R, boolean, int, int)} instead.
     *
     * @param startRowKey        Row start
     * @param endRowKey          Row end
     * @param startRowInclusive  whether we should include the start row when scan?
     * @param endRowInclusive    whether we should include the end row when scan?
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return List of rows corresponding to row keys passed, deserialized as objects of your bean-like class
     */
    public CompletableFuture<List<T>> get(@Nonnull final R startRowKey, final boolean startRowInclusive, @Nonnull final R endRowKey, final boolean endRowInclusive, final int numVersionsToFetch) {
        final Scan scan = new Scan()
                .withStartRow(toBytes(startRowKey), startRowInclusive)
                .withStopRow(toBytes(endRowKey), endRowInclusive)
                .readVersions(numVersionsToFetch);
        return get(scan);
    }

    /**
     * Get records from HBase table for a given {@link Scan} object.
     *

     * Caution: If you expect large number or rows for given scan criteria, do not use this method. Use the iterable variant {@link #records(Scan)} instead.
     *
     * @param scan HBase's scan object
     * @return Records corresponding to {@link Scan} object passed, deserialized as objects of your bean-like class
     */
    public CompletableFuture<List<T>> get(@Nonnull final Scan scan) {

        return getHBaseTable()
                .scanAll(scan)
                .thenApply(results -> results.stream().map(mapResultToRecordType()).collect(Collectors.toList()));
    }

    /**
     * Get specified number of versions of rows by a range of row keys (start to end)
     *
     * @param startRowKey Row start
     * @param endRowKey   Row end
     * @return List of rows corresponding to row keys passed, deserialized as objects of your bean-like class
     */
    public CompletableFuture<List<T>> get(@Nonnull final R startRowKey, @Nonnull final R endRowKey) {
        return get(startRowKey, endRowKey, 1);
    }

    /**
     * Get records whose row keys match provided prefix
     *

     * Caution: If you expect large number or rows for given row key prefix, do not use this method. Use the iterable variant {@link #recordsByPrefix(byte[], int)} instead.
     *
     * @param rowPrefix          Prefix to scan for
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return Records corresponding to provided prefix, deserialized as list of objects of your bean-like class
     */
    public CompletableFuture<List<T>> getByPrefix(@Nonnull final byte[] rowPrefix, int numVersionsToFetch) {
        final Scan scan = new Scan()
                .setRowPrefixFilter(rowPrefix)
                .readVersions(numVersionsToFetch);
        return get(scan);
    }

    /**
     * Get records whose row keys match provided prefix
     *

     * Caution: If you expect large number or rows for given row key prefix, do not use this method. Use the iterable variant {@link #recordsByPrefix(byte[])} instead.
     *
     * @param rowPrefix Prefix to scan for
     * @return Records corresponding to {@link Scan} object passed, deserialized as objects of your bean-like class
     */
    public CompletableFuture<List<T>> getByPrefix(@Nonnull final byte[] rowPrefix) {
        return getByPrefix(rowPrefix, 1);
    }

    /**
     * Get an iterable to iterate over records matching given {@link Scan} object
     *
     * @param scan HBase's scan object
     * @return An iterable to iterate over records matching the scan criteria
     */
    public Records<T> records(@Nonnull final Scan scan) {
        return new ReactiveRecords<>(getHBaseTable().getScanner(scan), hbObjectMapper, hbRecordClass);
    }

    /**
     * Get an iterable to iterate over records matching given row key prefix
     *
     * @param rowPrefix Prefix to scan for
     * @return An iterable to iterate over records matching the scan criteria
     */
    public Records<T> recordsByPrefix(@Nonnull final byte[] rowPrefix) {
        return recordsByPrefix(rowPrefix, 1);
    }

    /**
     * Get an iterable to iterate over records matching given row key prefix and fetch specific number of versions
     *
     * @param rowPrefix          Prefix to scan for
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return An iterable over objects of your bean-like class
     */
    public Records<T> recordsByPrefix(@Nonnull final byte[] rowPrefix, int numVersionsToFetch) {
        final Scan scan = new Scan()
                .setRowPrefixFilter(rowPrefix)
                .readVersions(numVersionsToFetch);
        return records(scan);
    }

    /**
     * Get an iterable to iterate over records matching range of row keys (start to end)
     *
     * @param startRowKey Row start (inclusive)
     * @param endRowKey   Row end (exclusive)
     * @return An iterable over objects of your bean-like class
     */
    public Iterable<T> records(@Nonnull final R startRowKey, @Nonnull final R endRowKey) {
        Scan scan = new Scan()
                .withStartRow(toBytes(startRowKey))
                .withStopRow(toBytes(endRowKey));
        return records(scan);
    }

    /**
     * Get an iterable to iterate over records matching range of row keys (start to end) and other criteria
     *

     * Note: If you need advanced scanning, consider using {@link #records(Scan)}
     *
     * @param startRowKey        Row start
     * @param startRowInclusive  whether we should include the start row when scan
     * @param endRowKey          Row end
     * @param endRowInclusive    whether we should include the end row when scan
     * @param numVersionsToFetch Number of versions to be retrieved
     * @param numRowsForCaching  Number of rows for caching (higher values are faster but take more memory)
     * @return An iterable over objects of your bean-like class
     * @see HBase Scan caching
     */
    public Records<T> records(@Nonnull final R startRowKey, final boolean startRowInclusive, @Nonnull final R endRowKey, final boolean endRowInclusive, final int numVersionsToFetch, final int numRowsForCaching) {
        final Scan scan = new Scan()
                .withStartRow(toBytes(startRowKey), startRowInclusive)
                .withStopRow(toBytes(endRowKey), endRowInclusive)
                .readVersions(numVersionsToFetch)
                .setCaching(numRowsForCaching);
        return records(scan);
    }

    /**
     * Get an iterable to iterate over records matching range of row keys (start to end) and other criteria
     *
     * @param startRowKey        Row start
     * @param endRowKey          Row end
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return An iterable over objects of your bean-like class
     */
    public Records<T> records(@Nonnull final R startRowKey, @Nonnull final R endRowKey, final int numVersionsToFetch) {
        final Scan scan = new Scan()
                .withStartRow(toBytes(startRowKey))
                .withStopRow(toBytes(endRowKey))
                .readVersions(numVersionsToFetch);
        return records(scan);
    }

    /**
     * Increments field by specified amount
     *
     * @param rowKey    Row key of the record whose column needs to be incremented
     * @param fieldName Field that needs to be incremented (this must be of {@link Long} type)
     * @param amount    Amount by which the HBase column needs to be incremented
     * @return The new value, post increment
     */
    public CompletableFuture<Long> increment(@Nonnull final R rowKey, @Nonnull final String fieldName, final long amount) {
        final WrappedHBColumn hbColumn = validateAndGetLongColumn(fieldName);

        return getHBaseTable()
                .incrementColumnValue(toBytes(rowKey), hbColumn.familyBytes(), hbColumn.columnBytes(), amount);
    }

    /**
     * Increments field by specified amount
     *
     * @param rowKey     Row key of the record whose column needs to be incremented
     * @param fieldName  Field that needs to be incremented (this must be of {@link Long} type)
     * @param amount     Amount by which the HBase column needs to be incremented
     * @param durability The persistence guarantee for this increment (see {@link Durability})
     * @return The new value, post increment
     */
    public CompletableFuture<Long> increment(@Nonnull final R rowKey, @Nonnull final String fieldName, final long amount, @Nonnull final Durability durability) {
        final WrappedHBColumn hbColumn = validateAndGetLongColumn(fieldName);
        return getHBaseTable()
                .incrementColumnValue(toBytes(rowKey), hbColumn.familyBytes(), hbColumn.columnBytes(), amount, durability);
    }

    /**
     * Performs HBase {@link Table#increment} on the given {@link Increment} object

     *

     * Note:

     *
You may construct {@link Increment} object using the {@link #getIncrement(Serializable) getIncrement(R)} method

     *
Unlike the {@link #increment(Serializable, String, long)} methods, this method skips some validations (hence, be cautious)

     *

     *
     * @param increment HBase Increment object
     * @return Partial object containing (only) values  of fields that were incremented
     */
    public CompletableFuture<T> increment(@Nonnull final Increment increment) {

        return getHBaseTable()
                .increment(increment)
                .thenApply(mapResultToRecordType());
    }

    /**
     * Appends value of a field with the value provided. If the field is empty, the value provided becomes the value of the field.
     *

     * This operation applies to fields of types such as {@link String}. Use this on non-{@link String} fields only if you understand the semantics.
     *
     * @param rowKey        Row key of the record
     * @param fieldName     Name of the field whose value needs to be appended
     * @param valueToAppend Value to be appended
     * @return Partial object containing (only) value of field that was appended
     * @see Table#append(Append)
     * @see #append(Serializable, Map) append(R, Map)
     */
    public CompletableFuture<T> append(@Nonnull final R rowKey, @Nonnull final String fieldName, @Nonnull final Object valueToAppend) {
        final Map<String, Object> one = new HashMap<>(1);
        one.put(fieldName, valueToAppend);
        return append(rowKey, one);
    }

    /**
     * Appends values of fields with the values provided. For empty fields, the value provided becomes the value of the field.
     *

     * This operation applies to fields of types such as {@link String}. Use this on non-{@link String} fields only if you understand the semantics.
     *
     * @param rowKey         Row key of the record
     * @param valuesToAppend Map of field name of value to be appended
     * @return Partial object containing (only) values of fields that were appended
     * @see Table#append(Append)
     * @see #append(Serializable, String, Object) append(R, String, Object)
     */
    public CompletableFuture<T> append(@Nonnull final R rowKey, @Nonnull final Map<String, Object> valuesToAppend) {
        final Append append = getAppend(rowKey);
        for (final Map.Entry<String, Object> e : valuesToAppend.entrySet()) {
            final String fieldName = e.getKey();
            final Field field = getField(fieldName);
            final Object value = e.getValue();
            if (!field.getType().isAssignableFrom(value.getClass())) {
                throw new IllegalArgumentException(String.format("An attempt was made to append a value of type '%s' to field '%s', which is of type '%s' (incompatible)", value.getClass(), fieldName, field.getType()));
            }
            final WrappedHBColumn hbColumn = new WrappedHBColumn(field);
            append.addColumn(hbColumn.familyBytes(), hbColumn.columnBytes(),
                    hbObjectMapper.valueToByteArray((Serializable) value, hbColumn.codecFlags())
            );
        }
        return append(append);
    }

    /**
     * Performs HBase's {@link Table#append} on the given {@link Append} object

     *

     * Note:

     *
You may construct {@link Append} object using the {@link #getAppend(Serializable) getAppend(R)} method

     *
Unlike the {@link #append(Serializable, String, Object) append(R, String, Object)} and related methods, this method skips some validations. So, use this only if you need access to HBase's native methods.

     *

     *
     * @param append HBase's {@link Append} object
     * @return Partial object containing (only) values  of fields that were appended
     */
    public CompletableFuture<T> append(@Nonnull final Append append) {

        return getHBaseTable()
                .append(append)
                .thenApply(mapResultToRecordType());
    }

    /**
     * Persist your bean-like object (of a class that implements {@link HBRecord}) to HBase table
     *
     * @param record Object that needs to be persisted
     * @return Row key of the persisted object, represented as a {@link String}
     */
    public CompletableFuture<R> persist(@Nonnull final T record) {

        final Put put = hbObjectMapper.writeValueAsPut0(record);
        return getHBaseTable()
                .put(put)
                .thenApply(nothing -> record.composeRowKey());
    }

    /**
     * Persist a list of your bean-like objects (of a class that implements {@link HBRecord}) to HBase table (this is a bulk variant of {@link #persist(HBRecord)} method)
     *
     * @param records List of objects that needs to be persisted
     * @return Row keys of the persisted objects, represented as a {@link String}
     */
    public Stream<CompletableFuture<R>> persist(@Nonnull final List<T> records) {
        final List<Put> puts = new ArrayList<>(records.size());
        final List<R> rowKeys = new ArrayList<>(records.size());
        for (final T record : records) {
            puts.add(hbObjectMapper.writeValueAsPut0(record));
            rowKeys.add(record.composeRowKey());
        }

        final List<CompletableFuture<Void>> putResults = getHBaseTable()
                .put(puts);
        return IntStream
                .range(0, putResults.size())
                .mapToObj(index -> putResults.get(index).thenApply(nothing -> rowKeys.get(index)));
    }

    /**
     * Delete a row from an HBase table for a given row key
     *
     * @param rowKey row key to delete
     * @return nothing or an error if the operation has failed
     */
    public CompletableFuture<Void> delete(@Nonnull final R rowKey) {
        final Delete delete = new Delete(toBytes(rowKey));

        return getHBaseTable().delete(delete);
    }

    /**
     * Delete HBase row by object (of class that implements {@link HBRecord}
     *
     * @param record Object to delete
     * @return nothing or an error if the operation has failed
     */
    public CompletableFuture<Void> delete(@Nonnull final T record) {
        return this.delete(record.composeRowKey());
    }

    /**
     * Delete HBase rows for an array of row keys
     *
     * @param rowKeys row keys to delete
     * @return a stream of void results or error if the corresponding operation has failed
     */
    public Stream<CompletableFuture<Void>> delete(@Nonnull final R[] rowKeys) {
        final List<Delete> deletes = new ArrayList<>(rowKeys.length);
        for (final R rowKey : rowKeys) {
            deletes.add(new Delete(toBytes(rowKey)));
        }

        return getHBaseTable().delete(deletes)
                .stream();
    }

    /**
     * Delete HBase rows by object references
     *
     * @param records Records to delete
     * @return a stream of void results or error if the corresponding operation has failed
     */
    public Stream<CompletableFuture<Void>> delete(@Nonnull final List<T> records) {
        final List<Delete> deletes = new ArrayList<>(records.size());
        for (final T record : records) {
            deletes.add(new Delete(toBytes(record.composeRowKey())));
        }

        return getHBaseTable().delete(deletes)
                .stream();
    }

    /**
     * Fetch value of column for a given row key and field
     *
     * @param rowKey    Row key to reference HBase row
     * @param fieldName Name of the private variable of your bean-like object (of a class that implements {@link HBRecord}) whose corresponding column needs to be fetched
     * @return Value of the column (boxed), null if row with given rowKey doesn't exist or such field doesn't exist for the row
     */
    public CompletableFuture<Object> fetchFieldValue(@Nonnull final R rowKey, @Nonnull final String fieldName) {

        return fetchFieldValue(rowKey, fieldName, 1)
                .thenApply(fieldValues -> {
                    if (fieldValues == null || fieldValues.isEmpty()) {
                        return null;
                    } else {
                        return fieldValues.lastEntry().getValue();
                    }
                });
    }

    /**
     * Fetch multiple versions of column values by row key and field name
     *
     * @param rowKey             Row key to reference HBase row
     * @param fieldName          Name of the private variable of your bean-like object (of a class that implements {@link HBRecord}) whose corresponding column needs to be fetched
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return {@link NavigableMap} of timestamps and values of the column (boxed), null if row with given rowKey doesn't exist or such field doesn't exist for the row
     */
    public CompletableFuture<NavigableMap<Long, Object>> fetchFieldValue(@Nonnull final R rowKey, @Nonnull final String fieldName, int numVersionsToFetch) {
        @SuppressWarnings("unchecked") R[] array = (R[]) Array.newInstance(rowKeyClass, 1);
        array[0] = rowKey;
        return fetchFieldValues(array, fieldName, numVersionsToFetch)
                .thenApply(map -> map.get(rowKey));
    }

    /**
     * Fetch values of an HBase column for a range of row keys (start and end) and field name
     *
     * @param startRowKey Start row key (scan start)
     * @param endRowKey   End row key (scan end)
     * @param fieldName   Name of the private variable of your bean-like object (of a class that implements {@link HBRecord}) whose corresponding column needs to be fetched
     * @return Map of row key and column value
     */
    public CompletableFuture<Map<R, Object>> fetchFieldValues(@Nonnull final R startRowKey, @Nonnull final R endRowKey, @Nonnull final String fieldName) {

        return fetchFieldValues(startRowKey, endRowKey, fieldName, 1)
                .thenApply(multiVersionedMap -> toSingleVersioned(multiVersionedMap, 10));
    }

    /**
     * Fetch column values for a given array of row keys (bulk variant of method {@link #fetchFieldValue(Serializable, String) fetchFieldValue(R, String)})
     *
     * @param rowKeys   Array of row keys to fetch
     * @param fieldName Name of the private variable of your bean-like object (of a class that implements {@link HBRecord}) whose corresponding column needs to be fetched
     * @return Map of row key and column values
     */
    public CompletableFuture<Map<R, Object>> fetchFieldValues(R[] rowKeys, String fieldName) {

        return fetchFieldValues(rowKeys, fieldName, 1)
                .thenApply(multiVersionedMap -> toSingleVersioned(multiVersionedMap, rowKeys.length));
    }

    /**
     * Fetch specified number of versions of values of an HBase column for a range of row keys (start and end) and field name
     *
     * @param startRowKey        Start row key (scan start)
     * @param endRowKey          End row key (scan end)
     * @param fieldName          Name of the private variable of your bean-like object (of a class that implements {@link HBRecord}) whose corresponding column needs to be fetched
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return Map of row key and column values (versioned)
     */
    public CompletableFuture<NavigableMap<R, NavigableMap<Long, Object>>> fetchFieldValues(@Nonnull final R startRowKey, @Nonnull final R endRowKey, @Nonnull final String fieldName, int numVersionsToFetch) {
        final Field field = getField(fieldName);
        final WrappedHBColumn hbColumn = new WrappedHBColumn(field);
        final Scan scan = new Scan().withStartRow(toBytes(startRowKey)).withStopRow(toBytes(endRowKey));
        scan.addColumn(hbColumn.familyBytes(), hbColumn.columnBytes());
        scan.readVersions(numVersionsToFetch);
        final NavigableMap<R, NavigableMap<Long, Object>> map = new TreeMap<>();

        final ResultScanner resultScanner = getHBaseTable().getScanner(scan);
        for (final Result result : resultScanner) {
            populateFieldValuesToMap(field, result, map);
        }
        return CompletableFuture.completedFuture(map);
    }

    /**
     * Fetch specified number of versions of values of an HBase column for an array of row keys
     *
     * @param rowKeys            Array of row keys to fetch
     * @param fieldName          Name of the private variable of your bean-like object (of a class that implements {@link HBRecord}) whose corresponding column needs to be fetched
     * @param numVersionsToFetch Number of versions to be retrieved
     * @return Map of row key and column values (versioned)
     */
    public CompletableFuture<Map<R, NavigableMap<Long, Object>>> fetchFieldValues(@Nonnull final R[] rowKeys, @Nonnull final String fieldName, final int numVersionsToFetch) {
        final Field field = getField(fieldName);
        final WrappedHBColumn hbColumn = new WrappedHBColumn(field);
        final List<Get> gets = new ArrayList<>(rowKeys.length);
        for (final R rowKey : rowKeys) {
            final Get get = new Get(toBytes(rowKey));
            try {
                get.readVersions(numVersionsToFetch);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            get.addColumn(hbColumn.familyBytes(), hbColumn.columnBytes());
            gets.add(get);
        }
        final Map<R, NavigableMap<Long, Object>> map = new LinkedHashMap<>(rowKeys.length, 1.0f);

        final List<CompletableFuture<Result>> completableFutures = getHBaseTable()
                .get(gets);

        return CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[0]))
                .thenApply(nothing -> {
                    completableFutures.forEach(resultCompletableFuture -> {
                        final Result result = resultCompletableFuture.join();
                        populateFieldValuesToMap(field, result, map);
                    });
                    return map;
                });
    }

    /**
     * Check whether a row exists or not
     *
     * @param rowKey Row key
     * @return true if row with given row key exists
     */
    public CompletableFuture<Boolean> exists(@Nonnull final R rowKey) {

        return getHBaseTable()
                .exists(new Get(toBytes(rowKey)));
    }

    /**
     * Check whether specified rows exist or not
     *
     * @param rowKeys Row keys
     * @return Stream of completable futures with true/false values corresponding to whether row with given row keys exist
     */
    public Stream<CompletableFuture<Boolean>> exists(R[] rowKeys) {
        List<Get> gets = new ArrayList<>(rowKeys.length);
        for (R rowKey : rowKeys) {
            gets.add(new Get(
                    toBytes(rowKey)
            ));
        }
        return getHBaseTable()
                .exists(gets)
                .stream();
    }

    /**
     * Get reference to HBase table.
     *
     * @return {@link AsyncTable} object
     */
    public AsyncTable<AdvancedScanResultConsumer> getHBaseTable() {
        return connection.getTable(hbTable.getName());
    }

    private Get getGet(final R rowKey, final int numVersionsToFetch) {
        try {
            return new Get(toBytes(rowKey)).readVersions(numVersionsToFetch);
        } catch (IOException e) {
            throw new InvalidReadVersionsCountException(e.getMessage());
        }
    }
}


text:
__author__="mjk6zt"

from helper import greeting

greeting("hello, world")

redpajama_set_name: RedPajamaGithub


text:
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.1.3.6
description: >
  Throws TypeError when `this` is null
info: >
  21.1.3.6 String.prototype.endsWith ( searchString [ , endPosition] )

  1. Let O be RequireObjectCoercible(this value).
  2. Let S be ToString(O).
---*/

assert.throws(TypeError, function() {
  String.prototype.endsWith.call(null, '');
});


text:
<?php
function uploadImg ($target_dir, $file, $newName) {
  if(!file_exists($target_dir)){
    mkdir($target_dir);
  }
  $temp = explode(".", $file["name"]);
  $target_file = $target_dir.$newName. '.' . end($temp);
  if(move_uploaded_file($file["tmp_name"], $target_file)){
    return $target_file;
  }
  return;
}
?>


text:
"""
Main script for starting a webserver with input form and displaying the input
on a TFT display.
"""

import wifi_serv
wifi_serv.simpleserver()


text:
using NUnit.Framework;

namespace L4p.Common.ActionQueues.nunit
{
    [TestFixture]
    class When_queue_is_executed
    {
        [Test]
        public void All_actions_should_be_executed()
        {
            Assert.Fail();
        }

        [Test]
        public void All_actions_should_be_cleared()
        {
            Assert.Fail();
        }

        [Test]
        public void Failed_actions_should_be_tracked()
        {
            Assert.Fail();
        }
    }
}


text:
from oslo_log import log as logging

from tempest.api.volume import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import test

CONF = config.CONF
LOG = logging.getLogger(__name__)

class VolumesBackupsV2Test(base.BaseVolumeAdminTest):

    @classmethod
    def skip_checks(cls):
        super(VolumesBackupsV2Test, cls).skip_checks()
        if not CONF.volume_feature_enabled.backup:
            raise cls.skipException("Cinder backup feature disabled")

    @classmethod
    def resource_setup(cls):
        super(VolumesBackupsV2Test, cls).resource_setup()

        cls.volume = cls.create_volume()

    @test.idempotent_id('a66eb488-8ee1-47d4-8e9f-575a095728c6')
    def test_volume_backup_create_get_detailed_list_restore_delete(self):
        # Create backup
        backup_name = data_utils.rand_name('Backup')
        create_backup = self.backups_adm_client.create_backup
        backup = create_backup(self.volume['id'],
                               name=backup_name)
        self.addCleanup(self.backups_adm_client.delete_backup,
                        backup['id'])
        self.assertEqual(backup_name, backup['name'])
        self.admin_volume_client.wait_for_volume_status(
            self.volume['id'], 'available')
        self.backups_adm_client.wait_for_backup_status(backup['id'],
                                                       'available')

        # Get a given backup
        backup = self.backups_adm_client.show_backup(backup['id'])
        self.assertEqual(backup_name, backup['name'])

        # Get all backups with detail
        backups = self.backups_adm_client.list_backups(detail=True)
        self.assertIn((backup['name'], backup['id']),
                      [(m['name'], m['id']) for m in backups])

        # Restore backup
        restore = self.backups_adm_client.restore_backup(backup['id'])

        # Delete backup
        self.addCleanup(self.admin_volume_client.delete_volume,
                        restore['volume_id'])
        self.assertEqual(backup['id'], restore['backup_id'])
        self.backups_adm_client.wait_for_backup_status(backup['id'],
                                                       'available')
        self.admin_volume_client.wait_for_volume_status(
            restore['volume_id'], 'available')

class VolumesBackupsV1Test(VolumesBackupsV2Test):
    _api_version = 1


text:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>

#include <net/nfc/nci.h>
#include <net/nfc/nci_core.h>

/* NCI status codes to Unix errno mapping */
int nci_to_errno(__u8 code)
{
	switch (code) {
	case NCI_STATUS_OK:
		return 0;

	case NCI_STATUS_REJECTED:
		return -EBUSY;

	case NCI_STATUS_RF_FRAME_CORRUPTED:
		return -EBADMSG;

	case NCI_STATUS_NOT_INITIALIZED:
		return -EHOSTDOWN;

	case NCI_STATUS_SYNTAX_ERROR:
	case NCI_STATUS_SEMANTIC_ERROR:
	case NCI_STATUS_INVALID_PARAM:
	case NCI_STATUS_RF_PROTOCOL_ERROR:
	case NCI_STATUS_NFCEE_PROTOCOL_ERROR:
		return -EPROTO;

	case NCI_STATUS_UNKNOWN_GID:
	case NCI_STATUS_UNKNOWN_OID:
		return -EBADRQC;

	case NCI_STATUS_MESSAGE_SIZE_EXCEEDED:
		return -EMSGSIZE;

	case NCI_STATUS_DISCOVERY_ALREADY_STARTED:
		return -EALREADY;

	case NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED:
	case NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED:
		return -ECONNREFUSED;

	case NCI_STATUS_RF_TRANSMISSION_ERROR:
	case NCI_STATUS_NFCEE_TRANSMISSION_ERROR:
		return -ECOMM;

	case NCI_STATUS_RF_TIMEOUT_ERROR:
	case NCI_STATUS_NFCEE_TIMEOUT_ERROR:
		return -ETIMEDOUT;

	case NCI_STATUS_FAILED:
	default:
		return -ENOSYS;
	}
}
EXPORT_SYMBOL(nci_to_errno);


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlend2" inherits="AnimationNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		Blends two animations linearly inside of an [AnimationNodeBlendTree].
	</brief_description>
	<description>
		A resource to add to an [AnimationNodeBlendTree]. Blends two animations linearly based on an amount value in the [code][0.0, 1.0][/code] range.
	</description>
	<tutorials>
		<link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link>
		<link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
		<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
	</tutorials>
	<members>
		<member name="sync" type="bool" setter="set_use_sync" getter="is_using_sync" default="false">
			If [code]true[/code], sets the [code]optimization[/code] to [code]false[/code] when calling [method AnimationNode.blend_input], forcing the blended animations to update every frame.
		</member>
	</members>
</class>


text:
require File.dirname(__FILE__) + '/../test_helper'

class TestGitPath < Test::Unit::TestCase

  def setup
    set_file_paths
    @git = Git.open(@wdir)
  end

  def test_readables
    assert(@git.dir.readable?)
    assert(@git.index.readable?)
    assert(@git.repo.readable?)
  end

  def test_readables
    in_temp_dir do |dir|
      FileUtils.cp_r(@wdir, 'test')
      g = Git.open(File.join(dir, 'test'))

      assert(g.dir.writable?)
      assert(g.index.writable?)
      assert(g.repo.writable?)
    end
  end

end


text:
package org.neo4j.kernel.api.constraints;

import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.schema.ConstraintDefinition;
import org.neo4j.graphdb.schema.ConstraintType;
import org.neo4j.kernel.api.ReadOperations;
import org.neo4j.kernel.api.StatementTokenNameLookup;
import org.neo4j.kernel.api.TokenNameLookup;
import org.neo4j.kernel.api.exceptions.schema.CreateConstraintFailureException;
import org.neo4j.kernel.impl.coreapi.schema.InternalSchemaActions;
import org.neo4j.kernel.impl.coreapi.schema.RelationshipPropertyExistenceConstraintDefinition;

public class RelationshipPropertyExistenceConstraint extends RelationshipPropertyConstraint
{
    public RelationshipPropertyExistenceConstraint( int relTypeId, int propertyKeyId )
    {
        super( relTypeId, propertyKeyId );
    }

    @Override
    public void added( ChangeVisitor visitor ) throws CreateConstraintFailureException
    {
        visitor.visitAddedRelationshipPropertyExistenceConstraint( this );
    }

    @Override
    public void removed( ChangeVisitor visitor )
    {
        visitor.visitRemovedRelationshipPropertyExistenceConstraint( this );
    }

    @Override
    public ConstraintType type()
    {
        return ConstraintType.RELATIONSHIP_PROPERTY_EXISTENCE;
    }

    @Override
    public ConstraintDefinition asConstraintDefinition( InternalSchemaActions schemaActions, ReadOperations readOps )
    {
        StatementTokenNameLookup lookup = new StatementTokenNameLookup( readOps );
        return new RelationshipPropertyExistenceConstraintDefinition( schemaActions,
                DynamicRelationshipType.withName( lookup.relationshipTypeGetName( relationshipTypeId ) ),
                lookup.propertyKeyGetName( propertyKeyId ) );
    }

    @Override
    public String userDescription( TokenNameLookup tokenNameLookup )
    {
        String typeName = tokenNameLookup.relationshipTypeGetName( relationshipTypeId );
        String boundIdentifier = typeName.toLowerCase();
        return String.format( "CONSTRAINT ON ()-[ %s:%s ]-() ASSERT exists(%s.%s)",
                boundIdentifier, typeName, boundIdentifier, tokenNameLookup.propertyKeyGetName( propertyKeyId ) );
    }

    @Override
    public String toString()
    {
        return String.format( "CONSTRAINT ON ()-[ n:relationshipType[%s] ]-() ASSERT exists(n.property[%s])",
                relationshipTypeId, propertyKeyId );
    }
}


text:
package ro.pub.cs.systems.eim.practicaltest02;

import android.util.Log;

import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.HashMap;

public class CommunicationThread extends Thread {

    private ServerThread serverThread;
    private Socket socket;

    public CommunicationThread(ServerThread serverThread, Socket socket) {
        this.serverThread = serverThread;
        this.socket = socket;
    }

    @Override
    public void run() {
    	if(socket == null) {
    		Log.e(Constants.TAG, "[COMMUNICATION THREAD] Socket is null!");
    		return;
    	}

        try {
            BufferedReader bufferedReader = Utilities.getReader(socket);
            PrintWriter printWriter = Utilities.getWriter(socket);

            if(bufferedReader == null || printWriter == null) {
            	Log.e(Constants.TAG, "[COMMUNICATION THREAD] BufferedReader / PrintWriter are null!");
            	socket.close();
            	return;
            }

            String request = bufferedReader.readLine();

            HashMap<String, String> data = serverThread.getData();
            String socketAddress = socket.getLocalAddress().toString();
            String socketPort = socket.getLocalPort() + "";
            String address = socketAddress + socketPort;
            String requestResult = null;

            Log.i(Constants.TAG, "[COMMUNICATION THREAD] Getting the information from the webservice...");
            HttpClient httpClient = new DefaultHttpClient();
            HttpGet httpGet = new HttpGet(Constants.WEB_SERVICE_ADDRESS);
            ResponseHandler<String> responseHandler = new BasicResponseHandler();
            String pageSourceCode = httpClient.execute(httpGet, responseHandler);

            if (data.containsKey(address)) {
                Log.i(Constants.TAG, "[COMMUNICATION THREAD] Getting the information from the cache...");
                requestResult = data.get(address);

                // Parse time and check if one minute passed here ...
                boolean firstTime = true;
                StringBuilder sb = new StringBuilder();
                for(int i = 0; i < requestResult.length(); ++i) {
                	if(requestResult.charAt(i) == ':') {
                		if(!firstTime) {
                			continue;
                		}

                		sb.append(requestResult.charAt(i));
                	}
                }

                String time = sb.toString();
            } else {
                serverThread.setData(socketAddress, pageSourceCode);
                requestResult = pageSourceCode;
            }

            if (requestResult != null) {
                String result = requestResult;
                printWriter.println(result);
                printWriter.flush();
            } else {
                Log.e(Constants.TAG, "[COMMUNICATION THREAD] Time information is null!");
            }

            socket.close();
        } catch (IOException ioException) {
            Log.e(Constants.TAG, "[COMMUNICATION THREAD] An exception has occurred: " + ioException.getMessage());
            if (Constants.DEBUG) {
                ioException.printStackTrace();
            }
        }
    }
}


text:
<?php
/**
 * This file belongs to the AnoynmFramework
 *
 * @author vahitserifsaglam <vahit.serif119@gmail.com>
 * @see http://gemframework.com
 *
 * Thanks for using
 */

namespace App\Services;

use Anonym\Application\ServiceProvider;
use Anonym\Route\AccessBag;

/**
 * Class MiddlewareService
 * @package App\Services
 */
class MiddlewareService extends ServiceProvider
{

    /**
     * the list of middlewares
     *
     * @var array
     */
    protected $middleware = [
    ];

    /**
     * register the provider
     *
     * @return mixed
     */
    public function register()
    {
        AccessBag::setAccesses($this->middleware);
    }
}


text:
import { Component } from '@angular/core';

@Component({
    selector: 'presentacio-page',
    templateUrl: './presentacio.component.html'
})
export class PresentacioPageContainer {
}


text:
using System.Collections.Generic;
using Amazon.S3.Model;
using Moq;
using SimpleGallery.Aws.Model;
using Xunit;

namespace SimpleGallery.Aws.Tests
{
    public class IndexedAwsItemTests
    {
        [Fact]
        public void IndexComparesToItem()
        {
            var s3Object = new S3Object
            {
                BucketName = "bucket",
                ETag = "hash23",
                Key = "path/to/item.jpg",
            };
            var s3Handler = new Mock<IS3ItemStore>();
            var item = new AwsGalleryImage(s3Object, s3Handler.Object);

            var index = new IndexedAwsItem("item.jpg", "path/to/item.jpg", new HashSet<string>(), "hash23", false);

            Assert.False(index.RequiresUpdate(item));
        }
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/compute/v1/compute.proto

package com.google.cloud.compute.v1;

/**
 *
 *
 *

 *

 *
 * Protobuf type {@code google.cloud.compute.v1.ImageFamilyView}
 */
public final class ImageFamilyView extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.ImageFamilyView)
    ImageFamilyViewOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ImageFamilyView.newBuilder() to construct.
  private ImageFamilyView(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ImageFamilyView() {}

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new ImageFamilyView();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_ImageFamilyView_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_ImageFamilyView_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.compute.v1.ImageFamilyView.class,
            com.google.cloud.compute.v1.ImageFamilyView.Builder.class);
  }

  private int bitField0_;
  public static final int IMAGE_FIELD_NUMBER = 100313435;
  private com.google.cloud.compute.v1.Image image_;
  /**
   *
   *
   *

   * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
   *

   *
   * optional .google.cloud.compute.v1.Image image = 100313435;
   *
   * @return Whether the image field is set.
   */
  @java.lang.Override
  public boolean hasImage() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   *
   *
   *

   * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
   *

   *
   * optional .google.cloud.compute.v1.Image image = 100313435;
   *
   * @return The image.
   */
  @java.lang.Override
  public com.google.cloud.compute.v1.Image getImage() {
    return image_ == null ? com.google.cloud.compute.v1.Image.getDefaultInstance() : image_;
  }
  /**
   *
   *
   *

   * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
   *

   *
   * optional .google.cloud.compute.v1.Image image = 100313435;
   */
  @java.lang.Override
  public com.google.cloud.compute.v1.ImageOrBuilder getImageOrBuilder() {
    return image_ == null ? com.google.cloud.compute.v1.Image.getDefaultInstance() : image_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(100313435, getImage());
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(100313435, getImage());
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.compute.v1.ImageFamilyView)) {
      return super.equals(obj);
    }
    com.google.cloud.compute.v1.ImageFamilyView other =
        (com.google.cloud.compute.v1.ImageFamilyView) obj;

    if (hasImage() != other.hasImage()) return false;
    if (hasImage()) {
      if (!getImage().equals(other.getImage())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasImage()) {
      hash = (37 * hash) + IMAGE_FIELD_NUMBER;
      hash = (53 * hash) + getImage().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.ImageFamilyView parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.compute.v1.ImageFamilyView prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   *

   *
   * Protobuf type {@code google.cloud.compute.v1.ImageFamilyView}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.ImageFamilyView)
      com.google.cloud.compute.v1.ImageFamilyViewOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_ImageFamilyView_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_ImageFamilyView_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.compute.v1.ImageFamilyView.class,
              com.google.cloud.compute.v1.ImageFamilyView.Builder.class);
    }

    // Construct using com.google.cloud.compute.v1.ImageFamilyView.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getImageFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (imageBuilder_ == null) {
        image_ = null;
      } else {
        imageBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_ImageFamilyView_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.ImageFamilyView getDefaultInstanceForType() {
      return com.google.cloud.compute.v1.ImageFamilyView.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.ImageFamilyView build() {
      com.google.cloud.compute.v1.ImageFamilyView result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.ImageFamilyView buildPartial() {
      com.google.cloud.compute.v1.ImageFamilyView result =
          new com.google.cloud.compute.v1.ImageFamilyView(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        if (imageBuilder_ == null) {
          result.image_ = image_;
        } else {
          result.image_ = imageBuilder_.build();
        }
        to_bitField0_ |= 0x00000001;
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.compute.v1.ImageFamilyView) {
        return mergeFrom((com.google.cloud.compute.v1.ImageFamilyView) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.compute.v1.ImageFamilyView other) {
      if (other == com.google.cloud.compute.v1.ImageFamilyView.getDefaultInstance()) return this;
      if (other.hasImage()) {
        mergeImage(other.getImage());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 802507482:
              {
                input.readMessage(getImageFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 802507482
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private com.google.cloud.compute.v1.Image image_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.compute.v1.Image,
            com.google.cloud.compute.v1.Image.Builder,
            com.google.cloud.compute.v1.ImageOrBuilder>
        imageBuilder_;
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     *
     * @return Whether the image field is set.
     */
    public boolean hasImage() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     *
     * @return The image.
     */
    public com.google.cloud.compute.v1.Image getImage() {
      if (imageBuilder_ == null) {
        return image_ == null ? com.google.cloud.compute.v1.Image.getDefaultInstance() : image_;
      } else {
        return imageBuilder_.getMessage();
      }
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    public Builder setImage(com.google.cloud.compute.v1.Image value) {
      if (imageBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        image_ = value;
        onChanged();
      } else {
        imageBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      return this;
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    public Builder setImage(com.google.cloud.compute.v1.Image.Builder builderForValue) {
      if (imageBuilder_ == null) {
        image_ = builderForValue.build();
        onChanged();
      } else {
        imageBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      return this;
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    public Builder mergeImage(com.google.cloud.compute.v1.Image value) {
      if (imageBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)
            && image_ != null
            && image_ != com.google.cloud.compute.v1.Image.getDefaultInstance()) {
          image_ =
              com.google.cloud.compute.v1.Image.newBuilder(image_).mergeFrom(value).buildPartial();
        } else {
          image_ = value;
        }
        onChanged();
      } else {
        imageBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      return this;
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    public Builder clearImage() {
      if (imageBuilder_ == null) {
        image_ = null;
        onChanged();
      } else {
        imageBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    public com.google.cloud.compute.v1.Image.Builder getImageBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getImageFieldBuilder().getBuilder();
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    public com.google.cloud.compute.v1.ImageOrBuilder getImageOrBuilder() {
      if (imageBuilder_ != null) {
        return imageBuilder_.getMessageOrBuilder();
      } else {
        return image_ == null ? com.google.cloud.compute.v1.Image.getDefaultInstance() : image_;
      }
    }
    /**
     *
     *
     *

     * The latest image that is part of the specified image family in the requested location, and that is not deprecated.
     *

     *
     * optional .google.cloud.compute.v1.Image image = 100313435;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.compute.v1.Image,
            com.google.cloud.compute.v1.Image.Builder,
            com.google.cloud.compute.v1.ImageOrBuilder>
        getImageFieldBuilder() {
      if (imageBuilder_ == null) {
        imageBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.compute.v1.Image,
                com.google.cloud.compute.v1.Image.Builder,
                com.google.cloud.compute.v1.ImageOrBuilder>(
                getImage(), getParentForChildren(), isClean());
        image_ = null;
      }
      return imageBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.ImageFamilyView)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.ImageFamilyView)
  private static final com.google.cloud.compute.v1.ImageFamilyView DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.compute.v1.ImageFamilyView();
  }

  public static com.google.cloud.compute.v1.ImageFamilyView getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ImageFamilyView> PARSER =
      new com.google.protobuf.AbstractParser<ImageFamilyView>() {
        @java.lang.Override
        public ImageFamilyView parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<ImageFamilyView> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ImageFamilyView> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.compute.v1.ImageFamilyView getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
using UnityEngine;
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_NavMeshAgent : LuaObject {
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent o;
			o=new UnityEngine.NavMeshAgent();
			pushValue(l,o);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SetDestination(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 a1;
			checkType(l,2,out a1);
			var ret=self.SetDestination(a1);
			pushValue(l,ret);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int ActivateCurrentOffMeshLink(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			System.Boolean a1;
			checkType(l,2,out a1);
			self.ActivateCurrentOffMeshLink(a1);
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int CompleteOffMeshLink(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			self.CompleteOffMeshLink();
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int Warp(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 a1;
			checkType(l,2,out a1);
			var ret=self.Warp(a1);
			pushValue(l,ret);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int Move(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 a1;
			checkType(l,2,out a1);
			self.Move(a1);
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int Stop(IntPtr l) {
		try {
			int argc = LuaDLL.lua_gettop(l);
			if(argc==1){
				UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
				self.Stop();
				return 0;
			}
			else if(argc==2){
				UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
				System.Boolean a1;
				checkType(l,2,out a1);
				self.Stop(a1);
				return 0;
			}
			LuaDLL.luaL_error(l,"No matched override function to call");
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int Resume(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			self.Resume();
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int ResetPath(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			self.ResetPath();
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SetPath(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.NavMeshPath a1;
			checkType(l,2,out a1);
			var ret=self.SetPath(a1);
			pushValue(l,ret);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int FindClosestEdge(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.NavMeshHit a1;
			var ret=self.FindClosestEdge(out a1);
			pushValue(l,ret);
			pushValue(l,a1);
			return 2;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int Raycast(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 a1;
			checkType(l,2,out a1);
			UnityEngine.NavMeshHit a2;
			var ret=self.Raycast(a1,out a2);
			pushValue(l,ret);
			pushValue(l,a2);
			return 2;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int CalculatePath(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 a1;
			checkType(l,2,out a1);
			UnityEngine.NavMeshPath a2;
			checkType(l,3,out a2);
			var ret=self.CalculatePath(a1,a2);
			pushValue(l,ret);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SamplePathPosition(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			System.Int32 a1;
			checkType(l,2,out a1);
			System.Single a2;
			checkType(l,3,out a2);
			UnityEngine.NavMeshHit a3;
			var ret=self.SamplePathPosition(a1,a2,out a3);
			pushValue(l,ret);
			pushValue(l,a3);
			return 2;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SetLayerCost(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			System.Int32 a1;
			checkType(l,2,out a1);
			System.Single a2;
			checkType(l,3,out a2);
			self.SetLayerCost(a1,a2);
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int GetLayerCost(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			System.Int32 a1;
			checkType(l,2,out a1);
			var ret=self.GetLayerCost(a1);
			pushValue(l,ret);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_destination(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.destination);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_destination(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 v;
			checkType(l,2,out v);
			self.destination=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_stoppingDistance(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.stoppingDistance);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_stoppingDistance(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.stoppingDistance=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_velocity(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.velocity);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_velocity(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 v;
			checkType(l,2,out v);
			self.velocity=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_nextPosition(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.nextPosition);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_nextPosition(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.Vector3 v;
			checkType(l,2,out v);
			self.nextPosition=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_steeringTarget(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.steeringTarget);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_desiredVelocity(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.desiredVelocity);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_remainingDistance(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.remainingDistance);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_baseOffset(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.baseOffset);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_baseOffset(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.baseOffset=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_isOnOffMeshLink(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.isOnOffMeshLink);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_currentOffMeshLinkData(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.currentOffMeshLinkData);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_nextOffMeshLinkData(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.nextOffMeshLinkData);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_autoTraverseOffMeshLink(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.autoTraverseOffMeshLink);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_autoTraverseOffMeshLink(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			bool v;
			checkType(l,2,out v);
			self.autoTraverseOffMeshLink=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_autoBraking(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.autoBraking);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_autoBraking(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			bool v;
			checkType(l,2,out v);
			self.autoBraking=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_autoRepath(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.autoRepath);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_autoRepath(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			bool v;
			checkType(l,2,out v);
			self.autoRepath=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_hasPath(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.hasPath);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_pathPending(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.pathPending);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_isPathStale(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.isPathStale);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_pathStatus(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushEnum(l,(int)self.pathStatus);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_pathEndPosition(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.pathEndPosition);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_path(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.path);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_path(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.NavMeshPath v;
			checkType(l,2,out v);
			self.path=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_walkableMask(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.walkableMask);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_walkableMask(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			int v;
			checkType(l,2,out v);
			self.walkableMask=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_speed(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.speed);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_speed(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.speed=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_angularSpeed(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.angularSpeed);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_angularSpeed(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.angularSpeed=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_acceleration(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.acceleration);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_acceleration(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.acceleration=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_updatePosition(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.updatePosition);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_updatePosition(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			bool v;
			checkType(l,2,out v);
			self.updatePosition=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_updateRotation(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.updateRotation);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_updateRotation(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			bool v;
			checkType(l,2,out v);
			self.updateRotation=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_radius(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.radius);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_radius(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.radius=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_height(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.height);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_height(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.height=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_obstacleAvoidanceType(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushEnum(l,(int)self.obstacleAvoidanceType);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_obstacleAvoidanceType(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			UnityEngine.ObstacleAvoidanceType v;
			checkEnum(l,2,out v);
			self.obstacleAvoidanceType=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_avoidancePriority(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			pushValue(l,self.avoidancePriority);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_avoidancePriority(IntPtr l) {
		try {
			UnityEngine.NavMeshAgent self=(UnityEngine.NavMeshAgent)checkSelf(l);
			int v;
			checkType(l,2,out v);
			self.avoidancePriority=v;
			return 0;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
	static public void reg(IntPtr l) {
		getTypeTable(l,"UnityEngine.NavMeshAgent");
		addMember(l,SetDestination);
		addMember(l,ActivateCurrentOffMeshLink);
		addMember(l,CompleteOffMeshLink);
		addMember(l,Warp);
		addMember(l,Move);
		addMember(l,Stop);
		addMember(l,Resume);
		addMember(l,ResetPath);
		addMember(l,SetPath);
		addMember(l,FindClosestEdge);
		addMember(l,Raycast);
		addMember(l,CalculatePath);
		addMember(l,SamplePathPosition);
		addMember(l,SetLayerCost);
		addMember(l,GetLayerCost);
		addMember(l,"destination",get_destination,set_destination,true);
		addMember(l,"stoppingDistance",get_stoppingDistance,set_stoppingDistance,true);
		addMember(l,"velocity",get_velocity,set_velocity,true);
		addMember(l,"nextPosition",get_nextPosition,set_nextPosition,true);
		addMember(l,"steeringTarget",get_steeringTarget,null,true);
		addMember(l,"desiredVelocity",get_desiredVelocity,null,true);
		addMember(l,"remainingDistance",get_remainingDistance,null,true);
		addMember(l,"baseOffset",get_baseOffset,set_baseOffset,true);
		addMember(l,"isOnOffMeshLink",get_isOnOffMeshLink,null,true);
		addMember(l,"currentOffMeshLinkData",get_currentOffMeshLinkData,null,true);
		addMember(l,"nextOffMeshLinkData",get_nextOffMeshLinkData,null,true);
		addMember(l,"autoTraverseOffMeshLink",get_autoTraverseOffMeshLink,set_autoTraverseOffMeshLink,true);
		addMember(l,"autoBraking",get_autoBraking,set_autoBraking,true);
		addMember(l,"autoRepath",get_autoRepath,set_autoRepath,true);
		addMember(l,"hasPath",get_hasPath,null,true);
		addMember(l,"pathPending",get_pathPending,null,true);
		addMember(l,"isPathStale",get_isPathStale,null,true);
		addMember(l,"pathStatus",get_pathStatus,null,true);
		addMember(l,"pathEndPosition",get_pathEndPosition,null,true);
		addMember(l,"path",get_path,set_path,true);
		addMember(l,"walkableMask",get_walkableMask,set_walkableMask,true);
		addMember(l,"speed",get_speed,set_speed,true);
		addMember(l,"angularSpeed",get_angularSpeed,set_angularSpeed,true);
		addMember(l,"acceleration",get_acceleration,set_acceleration,true);
		addMember(l,"updatePosition",get_updatePosition,set_updatePosition,true);
		addMember(l,"updateRotation",get_updateRotation,set_updateRotation,true);
		addMember(l,"radius",get_radius,set_radius,true);
		addMember(l,"height",get_height,set_height,true);
		addMember(l,"obstacleAvoidanceType",get_obstacleAvoidanceType,set_obstacleAvoidanceType,true);
		addMember(l,"avoidancePriority",get_avoidancePriority,set_avoidancePriority,true);
		createTypeMetatable(l,constructor, typeof(UnityEngine.NavMeshAgent),typeof(UnityEngine.Behaviour));
	}
}