text:
<?php

    require_once('config.php');

    use Paysafe\PaysafeApiClient;
    use Paysafe\Environment;
    use Paysafe\DirectDebit\Purchase;
    use Paysafe\DirectDebit\Filter;

if ($_POST)
    {
        try
        {
            if ($_POST['Paysafe'])
            {
                $submitPurchase = $_POST['Paysafe'];
            }
            if ($submitPurchase == 'ach_without_token' || $submitPurchase == 'ach_with_token' || $submitPurchase == "lookupPurchaseRequestACH" || $submitPurchase == 'cancelPurchaseRequestACH' || $submitPurchase == 'lookupPurchaseRequestACHMRN')
            {

                $client = new PaysafeApiClient($paysafeApiKeyId, $paysafeApiKeySecret, Environment::TEST, $paysafeAccountNumber);
            } elseif ($submitPurchase == 'eft_without_token' || $submitPurchase == 'eft_with_token' || $submitPurchase == "lookupPurchaseRequestEFT" || $submitPurchase == 'cancelPurchaseRequestEFT' || $submitPurchase == 'lookupPurchaseRequestEFTMRN')
            {

                $client = new PaysafeApiClient($paysafeApiKeyId, $paysafeApiKeySecret, Environment::TEST, $paysafeAccountNumber);
            } elseif ($submitPurchase == 'bacs_without_token' || $submitPurchase == 'bacs_with_token' || $submitPurchase == "lookupPurchaseRequestBACS" || $submitPurchase == 'cancelPurchaseRequestBACS' || $submitPurchase == 'lookupPurchaseRequestBACSMRN')
            {

                $client = new PaysafeApiClient($paysafeApiKeyId, $paysafeApiKeySecret, Environment::TEST, $paysafeAccountNumber);
            } elseif ($submitPurchase == 'sepa_without_token' || $submitPurchase == 'sepa_with_token' || $submitPurchase == "lookupPurchaseRequestSEPA" || $submitPurchase == 'cancelPurchaseRequestSEPA' || $submitPurchase == 'lookupPurchaseRequestSEPAMRN')
            {

                $client = new PaysafeApiClient($paysafeApiKeyId, $paysafeApiKeySecret, Environment::TEST, $paysafeAccountNumber);
            } else
            {
                $client = new PaysafeApiClient($paysafeApiKeyId, $paysafeApiKeySecret, Environment::TEST, $paysafeAccountNumber);
            }

            if ($submitPurchase == 'ach_without_token')
            {
                $purchase = $client->directDebitService()->submit(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num'],
                    'amount' => $_POST['amount'],
                    'ach' => array(
                        'accountHolderName' => "XYZ Company",
                        'accountType' => "CHECKING",
                        'accountNumber' => "988772192",
                        'routingNumber' => "211589828",
                        'payMethod' => "PPD"
                    ),
                    'profile' => array(
                        'firstName' => $_POST['firstName'],
                        'lastName' => $_POST['lastName'],
                        'email' => $_POST['email']
                    ),
                    'billingDetails' => array(
                        'street' => $_POST['street'],
                        'city' => $_POST['city'],
                        'state' => $_POST['state'],
                        'country' => $_POST['country'],
                        'zip' => $_POST['zip'],
                        'phone' => $_POST['phone']
                    )
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            }
            /* ACH using Payment  Token */ else if ($submitPurchase == 'ach_with_token')
            {

                $purchase = $client->directDebitService()->submit(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num'],
                    'amount' => $_POST['amount'],
                    'ach' => array(
                        //you will get payment tokenm, after account created.
                        'paymentToken' => $_POST['paymentToken'],
                        'payMethod' => "WEB"
                    )
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            }
            /* END ACH Using Payment Token */

            /* EFT without Payment Token */ else if ($submitPurchase == 'eft_without_token')
            {
                $purchase = $client->directDebitService()->submit(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num'],
                    'amount' => $_POST['amount'],
                    'eft' => array(
                        'accountHolderName' => "XYZ Company",
                        'accountNumber' => "336612",
                        'transitNumber' => "22446",
                        'institutionId' => "001"
                    ),
                    'profile' => array(
                        'firstName' => $_POST['firstName'],
                        'lastName' => $_POST['lastName'],
                        'email' => $_POST['email']
                    ),
                    'billingDetails' => array(
                        'street' => $_POST['street'],
                        'city' => $_POST['city'],
                        'state' => $_POST['state'],
                        'country' => $_POST['country'],
                        'zip' => $_POST['zip'],
                        'phone' => $_POST['phone']
                    )
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            }
            /* End EFT Without Payment Token */

            /*
             * EFT using payment Token
             */ else if ($submitPurchase == 'eft_with_token')
            {
                echo "
 in $submitPurchase";
                $purchase = $client->directDebitService()->submit(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num'],
                    'amount' => $_POST['amount'],
                    'eft' => array(
                        'paymentToken' => 'Dw6TqO65OiBamTA'//$_POST['paymentToken']//DQSSTfrd2TlkTMQ
                    )
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            }
            /* END EFT using Payment Token */

            /* BACS  USing Payment Token */ else if ($submitPurchase == 'bacs_with_token')
            {
                $purchase = $client->directDebitService()->submit(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num'],
                    'amount' => $_POST['amount'],
                    'bacs' => array(
                        'paymentToken' => $_POST['paymentToken']
                    )
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            } else if ($submitPurchase == 'sepa_with_token')
            {
                $purchase = $client->directDebitService()->submit(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num'],
                    'amount' => $_POST['amount'],
                    'sepa' => array(
                        'paymentToken' => $_POST['paymentToken']//DQSSTfrd2TlkTMQ
                    )
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            }
            /* END BACS  USing Payment Token */
            /* Cancel ACH without Payment Token */ else if ($submitPurchase == 'cancelPurchaseRequestACH' || $submitPurchase == 'cancelPurchaseRequestSEPA' || $submitPurchase == 'cancelPurchaseRequestBACS' || $submitPurchase == 'cancelPurchaseRequestEFT')
            {
                $purchase = $client->directDebitService()->cancelPurchase(new Purchase(array(
                    'id' => $_POST['paymentID'],
                    'status' => "CANCELLED"
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            } else if ($submitPurchase == 'lookupPurchaseRequestACH' || $submitPurchase == 'lookupPurchaseRequestEFT' || $submitPurchase == 'lookupPurchaseRequestSEPA' || $submitPurchase == 'lookupPurchaseRequestBACS')
            {
                $purchase = $client->directDebitService()->getPurchase(new Purchase(array(
                    'id' => $_POST['paymentID'],
                    'status' => "CANCELLED"
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            } else if ($submitPurchase == 'lookupPurchaseRequestACHMRN' || $submitPurchase == 'lookupPurchaseRequestEFTMRN' || $submitPurchase == 'lookupPurchaseRequestSEPAMRN' || $submitPurchase == 'lookupPurchaseRequestBACSMRN')
            {
                $purchase = $client->directDebitService()->getPurchases(new Purchase(array(
                    'merchantRefNum' => $_POST['merchant_ref_num']
                        )), new Filter(array(
                    'limit' => 15,
                    'offset' => 0
                )));
                echo "
";
                print_r($purchase);
                echo "
";
                die;
            }
            /* End cancel ACH without Payment Token */
            die('Payment successful! ID: ' . $purchase->id);
        } catch (Paysafe\PaysafeException $e)
        {
            echo '
';
            var_dump($e->getMessage());
            if ($e->fieldErrors)
            {
                var_dump($e->fieldErrors);
            }
            if ($e->links)
            {
                var_dump($e->links);
            }
            echo '
';
        } catch (Paysafe\PaysafeException $e)
        {
            //for debug only, these errors should be properly handled before production
            var_dump($e->getMessage());
        }
    }

?>
<!DOCTYPE html>

        <title>Paysafe SDK -Direct Debit</title>

        <form method="post">
            <fieldset>
                <legend>Billing Details</legend>

                        Street:
                        <input type="input" name="street" value="<?php

                            if (isset($_POST['street']))
                            {
                                echo $_POST['street'];
                            }

                        ?>"/>

                        Street 2:
                        <input type="input" name="street2" value="<?php

                            if (isset($_POST['street2']))
                            {
                                echo $_POST['street2'];
                            }

                        ?>"/>

                        City:
                        <input type="input" name="city" value="<?php

                            if (isset($_POST['city']))
                            {
                                echo $_POST['city'];
                            }

                        ?>"/>

                        State/Province:
                        <input type="input" name="state" value="<?php

                            if (isset($_POST['state']))
                            {
                                echo $_POST['state'];
                            } else
                            {
                                echo "ON";
                            }

                        ?>"/>

                        Country:
                        <select name="country">
                            <option value="CA"<?php

                                if (isset($_POST['country']) && $_POST['country'] == 'CA')
                                {
                                    echo ' selected';
                                }

                            ?>>Canada</option>
                            <option value="US"<?php

                                if (isset($_POST['country']) && $_POST['country'] == 'US')
                                {
                                    echo ' selected';
                                }

                            ?>>USA</option>
                        </select>

                        Zip/Postal Code:
                        <input type="input" name="zip" value="<?php

                            if (isset($_POST['zip']))
                            {
                                echo $_POST['zip'];
                            } else
                            {
                                echo "M5H 2N2";
                            }

                        ?>"/>

                        Phone:
                        <input type="input" name="phone" value="<?php

                            if (isset($_POST['phone']))
                            {
                                echo $_POST['phone'];
                            } else
                            {
                                echo "9988776655";
                            }

                        ?>"/>

            </fieldset>

            <fieldset>

                        First Name:
                        <input type="input" name="firstName" value="<?php

                            if (isset($_POST['firstName']))
                            {
                                echo $_POST['firstName'];
                            }

                        ?>"/>

                        Last Name:
                        <input type="input" name="lastName" value="<?php

                            if (isset($_POST['lastName']))
                            {
                                echo $_POST['lastName'];
                            }

                        ?>"/>

                        Email:
                        <input type="input" name="email" value="<?php

                            if (isset($_POST['email']))
                            {
                                echo $_POST['email'];
                            } else
                            {
                                echo "Joe.Smith@canada.com";
                            }

                        ?>"/>

                        SSN:
                        <input type="input" name="ssn" value="<?php

                            if (isset($_POST['ssn']))
                            {
                                echo $_POST['ssn'];
                            }

                        ?>"/>

                        Date OF Birth:
                        Date
                        <input type="input" name="day" value="<?php

                            if (isset($_POST['day']))
                            {
                                echo $_POST['day'];
                            }

                        ?>"/>
                        Month
                        <input type="input" name="month" value="<?php

                            if (isset($_POST['month']))
                            {
                                echo $_POST['month'];
                            }

                        ?>"/>
                        Year
                        <input type="input" name="year" value="<?php

                            if (isset($_POST['year']))
                            {
                                echo $_POST['year'];
                            }

                        ?>"/>

            </fieldset>
            <fieldset>

                        Merchant Ref Num:
                        <input type="input" name="merchant_ref_num" value="<?php

                            if (isset($_POST['merchant_ref_num']))
                            {
                                echo $_POST['merchant_ref_num'];
                            } else
                            {
                                echo uniqid(date('Ymd-'));
                            }

                        ?>"/>

                        Amount:
                        <input type="input" name="amount" value="<?php

                            if (isset($_POST['amount']))
                            {
                                echo $_POST['amount'];
                            } else
                            {
                                echo "100";
                            }

                        ?>"/>

                    Payment token : <input type="text" name="paymentToken" id="paymentToken" value="<?php

                        if (isset($_POST['paymentToken']))
                        {
                            echo $_POST['paymentToken'];
                        } else
                        {
                            echo "DmeucrpwVXlrLkw";
                        }

                    ?>"/> (required for EFT purchase with token)

                    Payment ID: <input type="text" name="paymentID" id="paymentID" value="<?php

                                           if (isset($_POST['paymentID']))
                                           {
                                               echo $_POST['paymentID'];
                                           } else
                                           {
                                               echo "f34369ee-8bd8-44d4-9554-7cec7d6ba4dc";
                                           }

                                       ?>"/>

            </fieldset>

            <fieldset>

Do Purchase

                                                <input type="radio" name="Paysafe" value="ach_without_token"/>
                                                ACH

                                                <input type="radio" name="Paysafe" value="ach_with_token"/>
                                                ACH with token

                                                <input type="radio" name="Paysafe" value="eft_without_token"/>EFT

                                                <input type="radio" name="Paysafe" value="eft_with_token"/>EFT  With Token

                                                <input type="radio" name="Paysafe" value="bacs_without_token"/>BACS

                                                <input type="radio" name="Paysafe" value="bacs_with_token"/>BACS  With Token

                                                <input type="radio" name="Paysafe" value="sepa_without_token"/>SEPA
                                                <input type="radio" name="Paysafe" value="sepa_with_token"/>SEPA  With Token

Lookup Purchase

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestACH" />ACH

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestEFT" />EFT

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestSEPA" />SEPA

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestBACS" />BACS

Cancel Purchase

                                                <input type="radio" name="Paysafe" value="cancelPurchaseRequestACH" /> ACH

                                                <input type="radio" name="Paysafe" value="cancelPurchaseRequestEFT" /> EFT

                                                <input type="radio" name="Paysafe" value="cancelPurchaseRequestSEPA" />SEPA

                                                <input type="radio" name="Paysafe" value="cancelPurchaseRequestBACS" /> BACS

Lookup Purchase using merchant Ref

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestACHMRN" />ACH

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestEFTMRN" />EFT

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestSEPAMRN" />SEPA

                                                <input type="radio" name="Paysafe" value="lookupPurchaseRequestBACSMRN" />BACS

            </fieldset>
            <input type="submit" />
        </form>


text:
.widget-file .trigger {
	position: relative;
	overflow: hidden;
}

.widget-file.dnd-hover .trigger {
	border-color: rgba(82, 168, 236, 0.8);
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6);
	outline: 0 none;
}

.widget-file .alert {
	padding: .375rem 1rem;
	line-height: 1.5;
}

.widget-file .trigger input {
	position: fixed;
	left: -8000px;
}

.widget-file .alert-danger,
.widget-file .reminder,
.widget-file .trigger {
	vertical-align: top;
}

.widget-file .reminder:not([value]),
.widget-file.uploading .reminder,
.widget-file.uploading .trigger,
.widget-file:not(.uploading) .uploading {
	display: none;
}

.widget-file .progress {
	display: inline-block;
	width: 32ex;
	height: 2.4rem;
	position: relative;
	border: 0;
	background: #E6E6E6;
	margin-bottom: 0;
	vertical-align: middle;
	overflow: hidden;
}

.widget-file .progress {
	border-radius: 3px;
}

.widget-file .progress .position {
	display: block;
	top: 0;
	left: 0;
	bottom: 0;
	color: white;
	background: #5BC0DE;
	position: absolute;
	text-align: right;
	font-size: .8em;
	overflow: hidden;
	width: 0;
}

.widget-file .progress .position .text {
	bottom: 0;
	line-height: 1em;
	margin-top: -0.5em;
	position: absolute;
	right: 1ex;
	top: 50%;
}

.widget-file:not(.has-danger) .alert-danger {
	display: none;
}

.widget-file .alert-danger {
	display: inline-block;
	margin-bottom: 0;
	max-width: 76ex;
}

.widget-file .infos {
	font-size: .8em;
	margin: 1em 0;
	background-color: white;
	padding: 1em;
	border: 1px solid #cfcfcf;
	border-radius: 4px;
}

.widget-file:not(.has-info) .infos {
	display: none;
}

.widget-file ul.details,
.widget-file div.preview {
	display: inline-block;
	vertical-align: top;
	margin-right: 1em;
}

.widget-file ul.details {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget-file div.preview img {
	padding: 2px;
	border: 1px solid #CCC;
	background-color: white;
	display: block;
}

.widget-file div.preview a img:hover {
	border-color: #A3C0E5;
}

.widget-file div.preview a.download {
	background: url(download-big.png) top center no-repeat;
	height: 0;
	width: 48px;
	padding-top: 48px;
	display: block;
	overflow: hidden;
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef LIEF_PE_BUILDER_H_
#define LIEF_PE_BUILDER_H_

#include <cstring>
#include <string>
#include <vector>
#include <iterator>
#include <iostream>
#include <ostream>
#include <sstream>
#include <algorithm>
#include <iomanip>

#include "LIEF/visibility.h"
#include "LIEF/utils.hpp"
#include "LIEF/iostream.hpp"

#include "LIEF/PE/Binary.hpp"
#include "LIEF/errors.hpp"

struct Profiler;

namespace LIEF {
namespace PE {

//! Class that is used to rebuild a raw PE binary from a PE::Binary object
class LIEF_API Builder {
  public:
  friend struct ::Profiler;

  Builder() = delete;
  Builder(Binary& binary);
  ~Builder();

  //! Perform the build process
  ok_error_t build();

  //! @brief Construct a ``jmp [address] @ from``.
  //!
  //! It is used when patching import table
  template<typename PE_T>
  static std::vector<uint8_t> build_jmp(uint64_t from, uint64_t address);

  //! @brief Construct a ``jmp far address @ from``.
  //!
  //! It is used for hooking
  template<typename PE_T>
  static std::vector<uint8_t> build_jmp_hook(uint64_t from, uint64_t address);

  //! @brief Rebuild the import table in new section
  Builder& build_imports(bool flag = true);

  //! @brief Patch the original import table in order to
  //! redirect functions to the new import table.
  //!
  //! This setting should be used with LIEF::PE::Builder::build_imports set to ``true``
  Builder& patch_imports(bool flag = true);

  //! @brief Rebuild the relocation table in another section
  Builder& build_relocations(bool flag = true);

  //! @brief Rebuild TLS object in another section
  Builder& build_tls(bool flag = true);

  //! @brief Rebuid the resources in another section
  Builder& build_resources(bool flag);

  //! @brief Rebuild the binary's overlay
  Builder& build_overlay(bool flag);

  //! @brief Rebuild the DOS stub content
  Builder& build_dos_stub(bool flag);

  //! @brief Return the build result
  const std::vector<uint8_t>& get_build();

  //! @brief Write the build result into the ``output`` file
  void write(const std::string& filename) const;

  //! @brief Write the build result into the ``os`` stream
  void write(std::ostream& os) const;

  LIEF_API friend std::ostream& operator<<(std::ostream& os, const Builder& b);

  ok_error_t build(const DosHeader& dos_header);
  ok_error_t build(const Header& bHeader);
  ok_error_t build(const OptionalHeader& optional_header);
  ok_error_t build(const DataDirectory& data_directory);
  ok_error_t build(const Section& section);

  protected:
  template<typename PE_T>
  ok_error_t build_optional_header(const OptionalHeader& optional_header);

  //! @brief Rebuild Import Table
  // TODO: Bug with x86
  template<typename PE_T>
  void build_import_table();

  template<typename PE_T>
  ok_error_t build_tls();

  ok_error_t build_relocation();
  ok_error_t build_resources();
  ok_error_t build_overlay();
  ok_error_t build_dos_stub();

  ok_error_t compute_resources_size(ResourceNode& node, uint32_t *header_size,
                              uint32_t *data_size, uint32_t *name_size);

  ok_error_t construct_resources(ResourceNode& node, std::vector<uint8_t>* content,
                           uint32_t* offset_header, uint32_t* offset_data, uint32_t* offset_name,
                           uint32_t base_rva, uint32_t depth);

  mutable vector_iostream ios_;
  Binary* binary_ = nullptr;

  bool build_imports_ = false;
  bool patch_imports_ = false;
  bool build_relocations_ = false;
  bool build_tls_ = false;
  bool build_resources_ = false;
  bool build_overlay_ = true;
  bool build_dos_stub_ = true;

};

}
}
#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/action_notifications"
        android:icon="@drawable/ic_menu_notifications"
        android:title="@string/nav_notifications"
        app:actionLayout="@layout/menu_badge_full"
        app:showAsAction="always"/>

</menu>


text:
package io.spotnext.support.util;

import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.reflect.FieldSignature;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper utility to handle all kinds of reflection stuff.
 *
 * @since 1.0
 * @author mojo2012
 * @version 1.0
 */
public class ClassUtil {

	private static final Logger LOG = LoggerFactory.getLogger(ClassUtil.class);

	/**
	 * Returns a {@link java.lang.reflect.Field} instance from the given {@link java.lang.Class} object. If the field does not exist, null is returned.
	 *
	 * @param type              a {@link java.lang.Class} object.
	 * @param fieldName         a {@link java.lang.String} object.
	 * @param includeSuperTypes if this is true all super classes till and including {@link java.lang.Object} will be invoked.
	 * @return a {@link java.lang.reflect.Field} object.
	 */
	public static Field getFieldDefinition(final Class<?> type, final String fieldName,
			final boolean includeSuperTypes) {

		assert StringUtils.isNotBlank(fieldName);

		Field field = null;

		boolean fieldRead = false;

		for (final Class<?> c : getAllSuperClasses(type, Object.class, true, true)) {
			try {
				field = c.getDeclaredField(fieldName);
				fieldRead = true;
				break;
			} catch (NoSuchFieldException | SecurityException e) {
				// ignore field
			}
		}

		if (!fieldRead) {
			if (LOG.isDebugEnabled()) {
				LOG.debug(String.format("Can't get field %s from class %s", fieldName, type.getName()));
			}
		}

		return field;
	}

	/**
	 * Returns all super classes of the given {@link java.lang.Class} in the order "most concrete class" to {@link java.lang.Object}.
	 *
	 * @param type              a {@link java.lang.Class} object.
	 * @param stopClass         {@link java.lang.Object} if null
	 * @param includeStopClass  if this is true, the stop class will be included. defaults to
	 * @param includeStartClass if this is true, the given {@link java.lang.Class} is included in the result
	 * @return a sorted list of all super classes of the given class.
	 */
	public static List<Class<?>> getAllSuperClasses(final Class<?> type, Class<?> stopClass,
			final boolean includeStopClass, final boolean includeStartClass) {

		if (stopClass == null) {
			stopClass = Object.class;
		}

		final List<Class<?>> types = new LinkedList<>();

		if (includeStartClass) {
			types.add(type);
		}

		Class<?> currentType = type;

		while (currentType.getSuperclass() != null && !currentType.getSuperclass().equals(stopClass)) {
			final Class<?> superClass = currentType.getSuperclass();

			types.add(superClass);
			currentType = superClass;
		}

		if (includeStopClass) {
			types.add(currentType.getSuperclass());
		}

		return types;
	}

	/**
	 * Set the field value for the given object. This silently fails if something goes wrong. something goes wrong.
	 *
	 * @param object    a {@link java.lang.Object} object.
	 * @param fieldName a {@link java.lang.String} object.
	 * @param value     a {@link java.lang.Object} object.
	 */
	public static void setField(final Object object, final String fieldName, final Object value) {
		setField(object, fieldName, value, true);
	}

	/**
	 * Set the field value for the given object. This silently fails if something goes wrong. something goes wrong.
	 *
	 * @param object             a {@link java.lang.Object} object.
	 * @param fieldName          a {@link java.lang.String} object.
	 * @param value              a {@link java.lang.Object} object.
	 * @param includeActualClass include actual class or only super classes?
	 */
	public static void setField(final Object object, final String fieldName, final Object value, boolean includeActualClass) {
		boolean fieldSet = false;

		for (final Class<?> c : getAllSuperClasses(object.getClass(), Object.class, false, includeActualClass)) {
			try {
				final Field field = c.getDeclaredField(fieldName);
				setAccessable(field);
				field.set(object, value);
				fieldSet = true;
				break;
			} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
				//
			}
		}

		if (!fieldSet) {
			// silently fail
			if (LOG.isDebugEnabled()) {
				LOG.debug(String.format("Can't set field %s from class %s", fieldName, object.getClass()));
			}
		}
	}

	/**
	 * Returns the field value for the given object. This silently fails if something goes wrong. something goes wrong.
	 *
	 * @param object                    a {@link java.lang.Object} object.
	 * @param fieldName                 a {@link java.lang.String} object.
	 * @param includeInAccessableFields a boolean.
	 * @return a {@link java.lang.Object} object.
	 */
	public static Object getField(final Object object, final String fieldName,
			final boolean includeInAccessableFields) {

		boolean fieldRead = false;
		Object retVal = null;

		for (final Class<?> c : getAllSuperClasses(object.getClass(), Object.class, false, true)) {
			try {
				final Field field = c.getDeclaredField(fieldName);

				if (includeInAccessableFields) {
					setAccessable(field);
				}

				retVal = field.get(object);
				fieldRead = true;
				break;
			} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
				// silently fail
			}
		}

		if (!fieldRead) {
			if (LOG.isDebugEnabled()) {
				LOG.debug(String.format("Can't get field %s from class %s", fieldName, object.getClass()));
			}
		}

		return retVal;
	}

	/**
	 *

	 * setAccessable.
	 *

	 *
	 * @param object a {@link java.lang.reflect.AccessibleObject} object.
	 */
	protected static void setAccessable(final AccessibleObject object) {
		AccessController.doPrivileged(new PrivilegedAction<Void>() {
			@Override
			public Void run() {
				object.setAccessible(true);
				return null;
			}
		});
	}

	/**
	 * Invokes a method on a given object. This silently fails if something goes wrong.
	 *
	 * @param object     a {@link java.lang.Object} object.
	 * @param methodName a {@link java.lang.String} object.
	 * @param args       a {@link java.lang.Object} object.
	 * @return a {@link java.lang.Object} object.
	 */
	public static Object invokeMethod(final Object object, final String methodName, final Object... args) {
		return invokeMethod(object, true, methodName, args);
	}

	/**
	 * Invokes a method on a given object. This silently fails if something goes wrong.
	 *
	 * @param object             a {@link java.lang.Object} object.
	 * @param includeActualClass include actual class or only super classes?
	 * @param methodName         a {@link java.lang.String} object.
	 * @param args               a {@link java.lang.Object} object.
	 * @return a {@link java.lang.Object} object.
	 */
	public static Object invokeMethod(final Object object, boolean includeActualClass, final String methodName, final Object... args) {
		Object retVal = null;

		final Class<?>[] paramArgs = new Class<?>[args.length];

		int i = 0;

		for (final Object arg : args) {
			paramArgs[i] = arg.getClass();
			i++;
		}

		Method method = null;

		// iterate over all superclasses and look for given method
		for (final Class<?> c : getAllAssignableClasses(object.getClass(), includeActualClass)) {
			try {
				final List<Method> possibleMethods = Stream.of(c.getDeclaredMethods())
						.filter(m -> methodName.equals(m.getName())).collect(Collectors.toList());

				for (final Method m : possibleMethods) {
					boolean matches = true;

					if (m.getParameterCount() == paramArgs.length) {
						for (int x = 0; x < m.getParameterCount(); x++) {
							if (!m.getParameterTypes()[x].isAssignableFrom(paramArgs[x])) {
								matches = false;
							}
						}

						if (matches) {
							method = m;
							break;
						}
					}
				}

			} catch (IllegalArgumentException | SecurityException e) {
				// silently fail
				if (LOG.isDebugEnabled()) {
					LOG.debug(String.format("Can't find method %s from class %s", methodName, c.getSimpleName()));
				}
			}

			if (method != null) {
				break;
			}
		}

		if (method != null) {
			setAccessable(method);

			try {
				retVal = method.invoke(object, args);
			} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
				// silently fail
				if (LOG.isDebugEnabled()) {
					LOG.debug(String.format("Can't invoke method %s from class %s", methodName,
							method.getDeclaringClass().getSimpleName()));
				}
			}
		}

		return retVal;
	}

	/**
	 * The whole class hierarchy is searched for fields with the given annotation.
	 *
	 * @param             the subtype of annotation
	 * @param type       the class to inspect
	 * @param annotation the annotation that must be present on the field
	 * @return all fields of the given class that have the given annotation.
	 */
	public static  Set<Field> getFieldsWithAnnotation(final Class<?> type,
			final Class annotation) {

		return getFields(type, field -> hasAnnotation(field, annotation));
	}

	/**
	 * Returns all fields of the type and all its super types.
	 *
	 * @param type must not be null
	 * @return all fields
	 */
	public static Set<Field> getAllFields(final Class<?> type) {
		return getFields(type, null);
	}

	/**
	 * Retrieves all fields recursively that match the given filter predicate.
	 *
	 * @param type   must not be null
	 * @param filter returns true for all selected fields. If null, all fields will be returned.
	 * @return all filtered fields
	 */
	public static Set<Field> getFields(final Class<?> type, Predicate<Field> filter) {
		final Set<Field> fields = new HashSet<>();

		for (final Class<?> c : getAllAssignableClasses(type, true)) {
			for (final Field field : c.getDeclaredFields()) {
				if (filter == null || filter.test(field)) {
					fields.add(field);
				}
			}
		}

		return fields;
	}

	/**
	 * Retrieves the method with the given name
	 *
	 * @param type       the class to inspect
	 * @param methodName of the method to retrieve
	 * @return the method with the given name, if found.
	 */
	public static Optional<Method> getMethodDefinition(Class<?> type, String methodName) {
		Set<Method> methods = getMethods(type, (m) -> m.getName().equals(methodName));

		if (methods.size() > 0) {
			return Optional.of(methods.iterator().next());
		}

		return Optional.empty();
	}

	/**
	 * Retrieves all methods recursively that match the given filter predicate.
	 *
	 * @param type   must not be null
	 * @param filter returns true for all selected methods. If null, all methods will be returned.
	 * @return all filtered methods
	 */
	public static Set<Method> getMethods(final Class<?> type, Predicate<Method> filter) {
		final Set<Method> methods = new HashSet<>();

		for (final Class<?> c : getAllAssignableClasses(type, true)) {
			for (final Method method : c.getDeclaredMethods()) {
				if (filter == null || filter.test(method)) {
					methods.add(method);
				}
			}
		}

		return methods;
	}

	/**
	 * The whole class hierarchy is searched for methods with the given annotation.
	 *
	 * @param             the subtype of annotation
	 * @param type       the class to inspect
	 * @param annotation the annotation that must be present on the method
	 * @return all methods of the given class that have the given annotation.
	 */
	public static  Set<Method> getMethodsWithAnnotation(final Class<?> type,
			final Class annotation) {

		final Set<Method> annotatedMethds = new HashSet<>();

		for (final Class<?> c : getAllAssignableClasses(type, true)) {
			for (final Method method : c.getDeclaredMethods()) {
				if (method.isAnnotationPresent(annotation)) {
					annotatedMethds.add(method);
				}
			}
		}

		return annotatedMethds;
	}

	/**
	 * Returns all assignable classes for the given class, starting with the actual class.
	 *
	 * @param type a {@link java.lang.Class} object.
	 * @return a {@link java.util.List} object.
	 */
	public static List<Class<?>> getAllAssignableClasses(final Class<?> type, boolean includeActualClass) {
		final List<Class<?>> classes = new ArrayList<>();

		if (includeActualClass) {
			classes.add(type);
		}

		classes.addAll(ClassUtils.getAllSuperclasses(type));

		return classes;
	}

	/**
	 * Checks for the presence of the given annotation on the given joinPoint.
	 *
	 * @param joinPoint  a {@link JoinPoint} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a boolean.
	 * @param  a A object.
	 */
	public static  boolean hasAnnotation(final JoinPoint joinPoint, final Class annotation) {
		return getAnnotation(joinPoint, annotation) != null;
	}

	/**
	 * Returns the given annotation object, if present. If the annotation is not found, null is returned.
	 *
	 * @param joinPoint  a {@link JoinPoint} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a A object.
	 * @param  a A object.
	 */
	public static  A getAnnotation(final JoinPoint joinPoint, final Class annotation) {
		A ret = null;

		final Signature sig = joinPoint.getSignature();

		if (sig instanceof MethodSignature) {
			final MethodSignature methodSignature = (MethodSignature) sig;
			Method method = methodSignature.getMethod();

			if (method.getDeclaringClass().isInterface()) {
				try {
					method = joinPoint.getTarget().getClass().getMethod(methodSignature.getName());
				} catch (NoSuchMethodException | SecurityException e) {
					// silently fail
				}
			}

			ret = method.getAnnotation(annotation);
		} else {
			final FieldSignature fieldSignature = (FieldSignature) sig;

			ret = fieldSignature.getField().getDeclaredAnnotation(annotation);
		}

		return ret;
	}

	/**
	 * Checks for the presence of the given annotation on the given class.
	 *
	 * @param type       a {@link java.lang.Class} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a boolean.
	 * @param  a A object.
	 */
	public static  boolean hasAnnotation(final Class<?> type, final Class annotation) {
		return getAnnotation(type, annotation) != null;
	}

	/**
	 * Returns the given annotation object, if present. If the annotation is not found, null is returned.
	 *
	 * @param type       a {@link java.lang.Class} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a A object.
	 * @param  a A object.
	 */
	public static  A getAnnotation(final Class<?> type, final Class annotation) {
		return type.getAnnotation(annotation);
	}

	/**
	 * Checks for the presence of the given annotation on the given member.
	 *
	 * @param member     a {@link java.lang.reflect.AccessibleObject} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a boolean.
	 * @param  a A object.
	 */
	public static  boolean hasAnnotation(final AccessibleObject member,
			final Class annotation) {
		return member.isAnnotationPresent(annotation);
	}

	/**
	 * Returns the given annotation object, if present. If the annotation is not found, null is returned.
	 *
	 * @param member     a {@link java.lang.reflect.AccessibleObject} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a A object.
	 * @param  a A object.
	 */
	public static  A getAnnotation(final AccessibleObject member, final Class annotation) {
		return member.getAnnotation(annotation);
	}

	/**
	 *

	 * getAnnotation.
	 *

	 *
	 * @param             the generic annotation type
	 * @param type       a {@link java.lang.Class} object.
	 * @param fieldName  a {@link java.lang.String} object.
	 * @param annotation a {@link java.lang.Class} object.
	 * @return a A object.
	 */
	public static  A getAnnotation(final Class<?> type, final String fieldName,
			final Class annotation) {

		try {
			return getAnnotation(getFieldDefinition(type, fieldName, true), annotation);
		} catch (final SecurityException e) {
			// silently ignore
			if (annotation != null && LOG.isDebugEnabled()) {
				LOG.debug(String.format("Can't get annotation %s for field %s from class %s",
						annotation.getSimpleName(), fieldName, type.getSimpleName()));
			}
		}

		return null;
	}

	/**
	 *

	 * getGenericCollectionType.
	 *

	 *
	 * @param field a {@link FieldSignature} object.
	 * @return a {@link java.lang.Class} object.
	 */
	public static Class<?> getGenericCollectionType(final FieldSignature field) {
		return getGenericCollectionType(field.getField());
	}

	/**
	 *

	 * getGenericCollectionType.
	 *

	 *
	 * @param field a {@link java.lang.reflect.Field} object.
	 * @return a {@link java.lang.Class} object.
	 */
	public static Class<?> getGenericCollectionType(final Field field) {
		final ParameterizedType paramType = (ParameterizedType) field.getGenericType();

		final Class<?> collectionType = (Class<?>) paramType.getActualTypeArguments()[0];

		return collectionType;
	}

	/**
	 *

	 * instantiate.
	 *

	 *
	 * @param type            a {@link java.lang.Class} object.
	 * @param constructorArgs a {@link java.lang.Object} object.
	 * @param                 <T> a T object.
	 * @return a {@link java.util.Optional} object.
	 */
	public static <T> Optional<T> instantiate(final Class<T> type, final Object... constructorArgs) {
		T instance = null;

		final Class<?> parentClass = type.getEnclosingClass();

		final List<Object> constructorArgValues = new ArrayList<>();
		if (constructorArgs != null) {
			constructorArgValues.addAll(Arrays.asList(constructorArgs));
		}

		final List<Class<?>> constructorArgTypes = new ArrayList<>();
		if (constructorArgs != null) {
			Stream.of(constructorArgs).forEach(a -> constructorArgTypes.add(a.getClass()));
		}

		// is inner class, first constructor argument is always the parent
		// class!
		if (parentClass != null && !Modifier.isStatic(type.getModifiers())) {
			constructorArgTypes.add(0, parentClass);
			constructorArgValues.add(0, null);
		}

		Constructor<T> matchingConstructor = null;

		for (final Constructor<?> c : type.getDeclaredConstructors()) {
			boolean found = c.getParameterCount() == constructorArgValues.size();

			for (int i = 0; i < c.getParameterTypes().length; i++) {
				if (c.getParameterCount() != constructorArgTypes.size()) {
					found = false;
					continue;
				}

				final Class<?> paramType = c.getParameterTypes()[i];

				if (i < constructorArgTypes.size()) {
					final Class<?> argumentType = constructorArgTypes.get(i);

					if (!paramType.isAssignableFrom(argumentType)) {
						found = false;
						break;
					}
				} else {
					break;
				}

			}

			if (found) {
				matchingConstructor = (Constructor<T>) c;
				break;
			} else {
				continue;
			}
		}

		if (matchingConstructor != null) {
			try {
				matchingConstructor.setAccessible(true);
				instance = matchingConstructor
						.newInstance(constructorArgValues.toArray(new Object[constructorArgValues.size()]));
			} catch (SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException
					| InvocationTargetException e) {
				LOG.debug(e.getMessage());
				// silently ignore
			}
		}

		return Optional.ofNullable(instance);
	}

	/**
	 *

	 * visitFields.
	 *

	 *
	 * @param object        a {@link java.lang.Object} object.
	 * @param fieldFilter   a {@link java.util.function.Predicate} object.
	 * @param fieldConsumer a {@link java.util.function.BiConsumer} object.
	 * @param recursive     a boolean.
	 */
	public static void visitFields(Object object, Predicate<Field> fieldFilter, BiConsumer<Field, Object> fieldConsumer,
			boolean recursive) {

		for (Field field : getFields(object.getClass(), fieldFilter)) {
			if (fieldFilter == null || fieldFilter.test(field)) {
				Object fieldValue = getField(object, field.getName(), true);

				if (fieldValue != null) {
					fieldConsumer.accept(field, fieldValue);

					if (recursive) {
						visitFields(fieldValue, fieldFilter, fieldConsumer, recursive);
					}
				}
			}
		}
	}

	/**
	 * Invokes the getter method for the given property name (= field name). The method MUST not have any parameters.
	 *
	 * @param object       to read from
	 * @param propertyName the name of the property/field
	 * @return the property value. If no matching getter is found, null is returned also.
	 */
	public static Object getProperty(Object object, String propertyName) {
		var methodName = createGetterMethodName(propertyName);
		var className = object.getClass();

		if (getMethodDefinition(className, methodName).isPresent()) {
			return invokeMethod(object, methodName);
		} else if (getMethodDefinition(className, propertyName).isPresent()) {
			return invokeMethod(object, propertyName);
		} else {
			return getField(object, propertyName, true);
		}
	}

	/**
	 * Invokes the setter method for the given property name (= field name). The method MUST only have one parameter.
	 *
	 * @param object       to write to
	 * @param propertyName the name of the property/field
	 * @param value        to write to the property. Missing setters are ignored.
	 */
	public static void setProperty(Object object, String propertyName, Object value) {
		String methodName = createSetterMethodName(propertyName);

		if (getMethodDefinition(object.getClass(), methodName).isPresent()) {
			invokeMethod(object, methodName, value);
		} else {
			setField(object, propertyName, value);
		}
	}

	private static String createGetterMethodName(String propertyName) {
		return createAccessorMethodName("get", propertyName);
	}

	private static String createSetterMethodName(String propertyName) {
		return createAccessorMethodName("set", propertyName);
	}

	private static String createAccessorMethodName(String accessType, String propertyName) {
		return accessType + propertyName.substring(0, 1).toUpperCase(Locale.getDefault()) + propertyName.substring(1);
	}
}


text:
/**
   package info.
 */
package ru.job4j.strategy;
/**
   class info.
 */
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
   test class.
 */
public class StrategyTest {
/**
   test triangleTest.
 */
@Test
public void triangleTest() {
        Paint paint = new Paint();
        Triangle triangle = new Triangle();
        paint.draw(triangle);
        assertEquals(paint.getS(), "  *   \n *** \n*****");
}
/**
   test Square.
 */
@Test
public void squareTest() {
        Paint paint = new Paint();
        Square square = new Square();
        paint.draw(square);
        assertEquals(paint.getS(), "####\n####\n####\n####");
}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<model model-package="com.dianping.cat.home.utilization"  enable-merger="true"  enable-sax-parser="true"
	enable-base-visitor="true"  enable-xml-parser="false"  enable-xml-builder="false"  enable-native-parser="true"  enable-native-builder="true">
   <entity name="utilization-report" root="true">
    <attribute name="domain" value-type="String" key="true"/>
    <attribute name="startTime" value-type="Date" format="yyyy-MM-dd HH:mm:ss" />
    <attribute name="endTime" value-type="Date" format="yyyy-MM-dd HH:mm:ss" />
    <entity-ref name="domain" type="map" names="domains"  method-find-or-create='true'/>
  </entity>
  <entity name="domain">
    <attribute name="id" value-type="String" key="true"/>
    <attribute name="cmdb-id" value-type="String"/>
    <attribute name="machine-number" value-type="int"  primitive="true"/>
    <entity-ref name="machineState" type="map" names="machineStates"  method-find-or-create='true'/>
    <entity-ref name="applicationState" type="map" names="applicationStates"  method-find-or-create='true'/>
  </entity>
  <entity name="machineState">
  	<attribute name="id" value-type="String" key="true"/>
    <attribute name="count" value-type="long"  primitive="true"/>
    <attribute name="sum" value-type="double"  format="0.0000" primitive="true"/>
    <attribute name="avg" value-type="double"  format="0.0000" primitive="true"/>
    <attribute name="avg-max" value-type="double"  format="0.0000" primitive="true"/>
  </entity>
  <entity name="applicationState">
  	<attribute name="id" value-type="String" key="true"/>
    <attribute name="failure-count" value-type="long"  primitive="true"/>
    <attribute name="failure-percent" value-type="double" format="0.000000" primitive="true"/>
    <attribute name="count" value-type="long"  primitive="true"/>
    <attribute name="maxQps" value-type="double"  format="0.0000" primitive="true"/>
    <attribute name="avg" value-type="double"  format="0.0000" primitive="true"/>
    <attribute name="sum" value-type="double"  format="0.0000" primitive="true"/>
    <attribute name="avg95" value-type="double" format="0.0000" primitive="true"/>
  </entity>
</model>


text:
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.tim.packet;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-22")
public class Tid implements org.apache.thrift.TBase<Tid, Tid._Fields>, java.io.Serializable, Cloneable, Comparable<Tid> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Tid");

  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField RESOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("resource", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField EXTRA_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("extraList", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField EXTRA_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("extraMap", org.apache.thrift.protocol.TType.MAP, (short)6);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new TidStandardSchemeFactory());
    schemes.put(TupleScheme.class, new TidTupleSchemeFactory());
  }

  /**
   * 登陆名   用户登录号,房间号等
   */
  public String name; // required
  /**
   * 域名 用于区分渠道等 appid,appsecret
   */
  public String domain; // optional
  /**
   * 系统 自行约定 如 : 1IOS,2android,3H5,4WEB 等
   */
  public String resource; // optional
  /**
   * normal,group
   */
  public String type; // optional
  /**
   * 附加信息:如传递客户端信息 iphone6,xiaomi,huawei等
   */
  public List<TimNode> extraList; // optional
  public Map<String,String> extraMap; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    /**
     * 登陆名   用户登录号,房间号等
     */
    NAME((short)1, "name"),
    /**
     * 域名 用于区分渠道等 appid,appsecret
     */
    DOMAIN((short)2, "domain"),
    /**
     * 系统 自行约定 如 : 1IOS,2android,3H5,4WEB 等
     */
    RESOURCE((short)3, "resource"),
    /**
     * normal,group
     */
    TYPE((short)4, "type"),
    /**
     * 附加信息:如传递客户端信息 iphone6,xiaomi,huawei等
     */
    EXTRA_LIST((short)5, "extraList"),
    EXTRA_MAP((short)6, "extraMap");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // NAME
          return NAME;
        case 2: // DOMAIN
          return DOMAIN;
        case 3: // RESOURCE
          return RESOURCE;
        case 4: // TYPE
          return TYPE;
        case 5: // EXTRA_LIST
          return EXTRA_LIST;
        case 6: // EXTRA_MAP
          return EXTRA_MAP;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final _Fields optionals[] = {_Fields.DOMAIN,_Fields.RESOURCE,_Fields.TYPE,_Fields.EXTRA_LIST,_Fields.EXTRA_MAP};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.RESOURCE, new org.apache.thrift.meta_data.FieldMetaData("resource", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.EXTRA_LIST, new org.apache.thrift.meta_data.FieldMetaData("extraList", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TimNode.class))));
    tmpMap.put(_Fields.EXTRA_MAP, new org.apache.thrift.meta_data.FieldMetaData("extraMap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Tid.class, metaDataMap);
  }

  public Tid() {
  }

  public Tid(
    String name)
  {
    this();
    this.name = name;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Tid(Tid other) {
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetDomain()) {
      this.domain = other.domain;
    }
    if (other.isSetResource()) {
      this.resource = other.resource;
    }
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetExtraList()) {
      List<TimNode> __this__extraList = new ArrayList<TimNode>(other.extraList.size());
      for (TimNode other_element : other.extraList) {
        __this__extraList.add(new TimNode(other_element));
      }
      this.extraList = __this__extraList;
    }
    if (other.isSetExtraMap()) {
      Map<String,String> __this__extraMap = new HashMap<String,String>(other.extraMap);
      this.extraMap = __this__extraMap;
    }
  }

  public Tid deepCopy() {
    return new Tid(this);
  }

  @Override
  public void clear() {
    this.name = null;
    this.domain = null;
    this.resource = null;
    this.type = null;
    this.extraList = null;
    this.extraMap = null;
  }

  /**
   * 登陆名   用户登录号,房间号等
   */
  public String getName() {
    return this.name;
  }

  /**
   * 登陆名   用户登录号,房间号等
   */
  public Tid setName(String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

  /** Returns true if field name is set (has been assigned a value) and false otherwise */
  public boolean isSetName() {
    return this.name != null;
  }

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  /**
   * 域名 用于区分渠道等 appid,appsecret
   */
  public String getDomain() {
    return this.domain;
  }

  /**
   * 域名 用于区分渠道等 appid,appsecret
   */
  public Tid setDomain(String domain) {
    this.domain = domain;
    return this;
  }

  public void unsetDomain() {
    this.domain = null;
  }

  /** Returns true if field domain is set (has been assigned a value) and false otherwise */
  public boolean isSetDomain() {
    return this.domain != null;
  }

  public void setDomainIsSet(boolean value) {
    if (!value) {
      this.domain = null;
    }
  }

  /**
   * 系统 自行约定 如 : 1IOS,2android,3H5,4WEB 等
   */
  public String getResource() {
    return this.resource;
  }

  /**
   * 系统 自行约定 如 : 1IOS,2android,3H5,4WEB 等
   */
  public Tid setResource(String resource) {
    this.resource = resource;
    return this;
  }

  public void unsetResource() {
    this.resource = null;
  }

  /** Returns true if field resource is set (has been assigned a value) and false otherwise */
  public boolean isSetResource() {
    return this.resource != null;
  }

  public void setResourceIsSet(boolean value) {
    if (!value) {
      this.resource = null;
    }
  }

  /**
   * normal,group
   */
  public String getType() {
    return this.type;
  }

  /**
   * normal,group
   */
  public Tid setType(String type) {
    this.type = type;
    return this;
  }

  public void unsetType() {
    this.type = null;
  }

  /** Returns true if field type is set (has been assigned a value) and false otherwise */
  public boolean isSetType() {
    return this.type != null;
  }

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

  public int getExtraListSize() {
    return (this.extraList == null) ? 0 : this.extraList.size();
  }

  public java.util.Iterator<TimNode> getExtraListIterator() {
    return (this.extraList == null) ? null : this.extraList.iterator();
  }

  public void addToExtraList(TimNode elem) {
    if (this.extraList == null) {
      this.extraList = new ArrayList<TimNode>();
    }
    this.extraList.add(elem);
  }

  /**
   * 附加信息:如传递客户端信息 iphone6,xiaomi,huawei等
   */
  public List<TimNode> getExtraList() {
    return this.extraList;
  }

  /**
   * 附加信息:如传递客户端信息 iphone6,xiaomi,huawei等
   */
  public Tid setExtraList(List<TimNode> extraList) {
    this.extraList = extraList;
    return this;
  }

  public void unsetExtraList() {
    this.extraList = null;
  }

  /** Returns true if field extraList is set (has been assigned a value) and false otherwise */
  public boolean isSetExtraList() {
    return this.extraList != null;
  }

  public void setExtraListIsSet(boolean value) {
    if (!value) {
      this.extraList = null;
    }
  }

  public int getExtraMapSize() {
    return (this.extraMap == null) ? 0 : this.extraMap.size();
  }

  public void putToExtraMap(String key, String val) {
    if (this.extraMap == null) {
      this.extraMap = new HashMap<String,String>();
    }
    this.extraMap.put(key, val);
  }

  public Map<String,String> getExtraMap() {
    return this.extraMap;
  }

  public Tid setExtraMap(Map<String,String> extraMap) {
    this.extraMap = extraMap;
    return this;
  }

  public void unsetExtraMap() {
    this.extraMap = null;
  }

  /** Returns true if field extraMap is set (has been assigned a value) and false otherwise */
  public boolean isSetExtraMap() {
    return this.extraMap != null;
  }

  public void setExtraMapIsSet(boolean value) {
    if (!value) {
      this.extraMap = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((String)value);
      }
      break;

    case DOMAIN:
      if (value == null) {
        unsetDomain();
      } else {
        setDomain((String)value);
      }
      break;

    case RESOURCE:
      if (value == null) {
        unsetResource();
      } else {
        setResource((String)value);
      }
      break;

    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((String)value);
      }
      break;

    case EXTRA_LIST:
      if (value == null) {
        unsetExtraList();
      } else {
        setExtraList((List<TimNode>)value);
      }
      break;

    case EXTRA_MAP:
      if (value == null) {
        unsetExtraMap();
      } else {
        setExtraMap((Map<String,String>)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case NAME:
      return getName();

    case DOMAIN:
      return getDomain();

    case RESOURCE:
      return getResource();

    case TYPE:
      return getType();

    case EXTRA_LIST:
      return getExtraList();

    case EXTRA_MAP:
      return getExtraMap();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case NAME:
      return isSetName();
    case DOMAIN:
      return isSetDomain();
    case RESOURCE:
      return isSetResource();
    case TYPE:
      return isSetType();
    case EXTRA_LIST:
      return isSetExtraList();
    case EXTRA_MAP:
      return isSetExtraMap();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof Tid)
      return this.equals((Tid)that);
    return false;
  }

  public boolean equals(Tid that) {
    if (that == null)
      return false;

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_domain = true && this.isSetDomain();
    boolean that_present_domain = true && that.isSetDomain();
    if (this_present_domain || that_present_domain) {
      if (!(this_present_domain && that_present_domain))
        return false;
      if (!this.domain.equals(that.domain))
        return false;
    }

    boolean this_present_resource = true && this.isSetResource();
    boolean that_present_resource = true && that.isSetResource();
    if (this_present_resource || that_present_resource) {
      if (!(this_present_resource && that_present_resource))
        return false;
      if (!this.resource.equals(that.resource))
        return false;
    }

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_extraList = true && this.isSetExtraList();
    boolean that_present_extraList = true && that.isSetExtraList();
    if (this_present_extraList || that_present_extraList) {
      if (!(this_present_extraList && that_present_extraList))
        return false;
      if (!this.extraList.equals(that.extraList))
        return false;
    }

    boolean this_present_extraMap = true && this.isSetExtraMap();
    boolean that_present_extraMap = true && that.isSetExtraMap();
    if (this_present_extraMap || that_present_extraMap) {
      if (!(this_present_extraMap && that_present_extraMap))
        return false;
      if (!this.extraMap.equals(that.extraMap))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_name = true && (isSetName());
    list.add(present_name);
    if (present_name)
      list.add(name);

    boolean present_domain = true && (isSetDomain());
    list.add(present_domain);
    if (present_domain)
      list.add(domain);

    boolean present_resource = true && (isSetResource());
    list.add(present_resource);
    if (present_resource)
      list.add(resource);

    boolean present_type = true && (isSetType());
    list.add(present_type);
    if (present_type)
      list.add(type);

    boolean present_extraList = true && (isSetExtraList());
    list.add(present_extraList);
    if (present_extraList)
      list.add(extraList);

    boolean present_extraMap = true && (isSetExtraMap());
    list.add(present_extraMap);
    if (present_extraMap)
      list.add(extraMap);

    return list.hashCode();
  }

  @Override
  public int compareTo(Tid other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDomain()).compareTo(other.isSetDomain());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDomain()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain, other.domain);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetResource()).compareTo(other.isSetResource());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResource()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resource, other.resource);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExtraList()).compareTo(other.isSetExtraList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExtraList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraList, other.extraList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExtraMap()).compareTo(other.isSetExtraMap());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExtraMap()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraMap, other.extraMap);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("Tid(");
    boolean first = true;

    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (isSetDomain()) {
      if (!first) sb.append(", ");
      sb.append("domain:");
      if (this.domain == null) {
        sb.append("null");
      } else {
        sb.append(this.domain);
      }
      first = false;
    }
    if (isSetResource()) {
      if (!first) sb.append(", ");
      sb.append("resource:");
      if (this.resource == null) {
        sb.append("null");
      } else {
        sb.append(this.resource);
      }
      first = false;
    }
    if (isSetType()) {
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
    }
    if (isSetExtraList()) {
      if (!first) sb.append(", ");
      sb.append("extraList:");
      if (this.extraList == null) {
        sb.append("null");
      } else {
        sb.append(this.extraList);
      }
      first = false;
    }
    if (isSetExtraMap()) {
      if (!first) sb.append(", ");
      sb.append("extraMap:");
      if (this.extraMap == null) {
        sb.append("null");
      } else {
        sb.append(this.extraMap);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (name == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TidStandardSchemeFactory implements SchemeFactory {
    public TidStandardScheme getScheme() {
      return new TidStandardScheme();
    }
  }

  private static class TidStandardScheme extends StandardScheme<Tid> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Tid struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // DOMAIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.domain = iprot.readString();
              struct.setDomainIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // RESOURCE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.resource = iprot.readString();
              struct.setResourceIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.type = iprot.readString();
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // EXTRA_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list54 = iprot.readListBegin();
                struct.extraList = new ArrayList<TimNode>(_list54.size);
                TimNode _elem55;
                for (int _i56 = 0; _i56 < _list54.size; ++_i56)
                {
                  _elem55 = new TimNode();
                  _elem55.read(iprot);
                  struct.extraList.add(_elem55);
                }
                iprot.readListEnd();
              }
              struct.setExtraListIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // EXTRA_MAP
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map57 = iprot.readMapBegin();
                struct.extraMap = new HashMap<String,String>(2*_map57.size);
                String _key58;
                String _val59;
                for (int _i60 = 0; _i60 < _map57.size; ++_i60)
                {
                  _key58 = iprot.readString();
                  _val59 = iprot.readString();
                  struct.extraMap.put(_key58, _val59);
                }
                iprot.readMapEnd();
              }
              struct.setExtraMapIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, Tid struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.domain != null) {
        if (struct.isSetDomain()) {
          oprot.writeFieldBegin(DOMAIN_FIELD_DESC);
          oprot.writeString(struct.domain);
          oprot.writeFieldEnd();
        }
      }
      if (struct.resource != null) {
        if (struct.isSetResource()) {
          oprot.writeFieldBegin(RESOURCE_FIELD_DESC);
          oprot.writeString(struct.resource);
          oprot.writeFieldEnd();
        }
      }
      if (struct.type != null) {
        if (struct.isSetType()) {
          oprot.writeFieldBegin(TYPE_FIELD_DESC);
          oprot.writeString(struct.type);
          oprot.writeFieldEnd();
        }
      }
      if (struct.extraList != null) {
        if (struct.isSetExtraList()) {
          oprot.writeFieldBegin(EXTRA_LIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.extraList.size()));
            for (TimNode _iter61 : struct.extraList)
            {
              _iter61.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.extraMap != null) {
        if (struct.isSetExtraMap()) {
          oprot.writeFieldBegin(EXTRA_MAP_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.extraMap.size()));
            for (Map.Entry<String, String> _iter62 : struct.extraMap.entrySet())
            {
              oprot.writeString(_iter62.getKey());
              oprot.writeString(_iter62.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TidTupleSchemeFactory implements SchemeFactory {
    public TidTupleScheme getScheme() {
      return new TidTupleScheme();
    }
  }

  private static class TidTupleScheme extends TupleScheme<Tid> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Tid struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeString(struct.name);
      BitSet optionals = new BitSet();
      if (struct.isSetDomain()) {
        optionals.set(0);
      }
      if (struct.isSetResource()) {
        optionals.set(1);
      }
      if (struct.isSetType()) {
        optionals.set(2);
      }
      if (struct.isSetExtraList()) {
        optionals.set(3);
      }
      if (struct.isSetExtraMap()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetDomain()) {
        oprot.writeString(struct.domain);
      }
      if (struct.isSetResource()) {
        oprot.writeString(struct.resource);
      }
      if (struct.isSetType()) {
        oprot.writeString(struct.type);
      }
      if (struct.isSetExtraList()) {
        {
          oprot.writeI32(struct.extraList.size());
          for (TimNode _iter63 : struct.extraList)
          {
            _iter63.write(oprot);
          }
        }
      }
      if (struct.isSetExtraMap()) {
        {
          oprot.writeI32(struct.extraMap.size());
          for (Map.Entry<String, String> _iter64 : struct.extraMap.entrySet())
          {
            oprot.writeString(_iter64.getKey());
            oprot.writeString(_iter64.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Tid struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.name = iprot.readString();
      struct.setNameIsSet(true);
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.domain = iprot.readString();
        struct.setDomainIsSet(true);
      }
      if (incoming.get(1)) {
        struct.resource = iprot.readString();
        struct.setResourceIsSet(true);
      }
      if (incoming.get(2)) {
        struct.type = iprot.readString();
        struct.setTypeIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list65 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.extraList = new ArrayList<TimNode>(_list65.size);
          TimNode _elem66;
          for (int _i67 = 0; _i67 < _list65.size; ++_i67)
          {
            _elem66 = new TimNode();
            _elem66.read(iprot);
            struct.extraList.add(_elem66);
          }
        }
        struct.setExtraListIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TMap _map68 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.extraMap = new HashMap<String,String>(2*_map68.size);
          String _key69;
          String _val70;
          for (int _i71 = 0; _i71 < _map68.size; ++_i71)
          {
            _key69 = iprot.readString();
            _val70 = iprot.readString();
            struct.extraMap.put(_key69, _val70);
          }
        }
        struct.setExtraMapIsSet(true);
      }
    }
  }

}


text:
require 'restclient'

module Imgur

  class Random

    def self.get
      imgur_json = RestClient.get("http://imgur.com/gallery.json")

      images = JSON.parse(imgur_json)["data"]

      sfw = images.select { |i| i["nsfw"] == false }

      random = sfw.sample

      "http://i.imgur.com/#{ random['hash'] }#{ random['ext'] }"
    end

  end

end


text:
namespace Google.Cloud.ManagedIdentities.V1.Snippets
{
    // [START managedidentities_v1_generated_ManagedIdentitiesService_DeleteDomain_sync_flattened]
    using Google.Cloud.ManagedIdentities.V1;
    using Google.LongRunning;
    using Google.Protobuf.WellKnownTypes;

    public sealed partial class GeneratedManagedIdentitiesServiceClientSnippets
    {
        /// <summary>Snippet for DeleteDomain</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteDomain()
        {
            // Create client
            ManagedIdentitiesServiceClient managedIdentitiesServiceClient = ManagedIdentitiesServiceClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/domains/[DOMAIN]";
            // Make the request
            Operation<Empty, OpMetadata> response = managedIdentitiesServiceClient.DeleteDomain(name);

            // Poll until the returned long-running operation is complete
            Operation<Empty, OpMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<Empty, OpMetadata> retrievedResponse = managedIdentitiesServiceClient.PollOnceDeleteDomain(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
        }
    }
    // [END managedidentities_v1_generated_ManagedIdentitiesService_DeleteDomain_sync_flattened]
}


text:
package com.bustiblelemons.adapters;

import android.content.Context;
import android.support.annotation.NonNull;
import android.util.SparseBooleanArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.bustiblelemons.bustiblelibs.R;
import com.bustiblelemons.holders.impl.ViewHolder;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * Created by bhm on 20.07.14.
 */
public abstract class AbsListAdapter<T, H extends ViewHolder<T>> extends BaseAdapter {
    public static String         TAG;
    private       List<T>        mData;
    private       Context        context;
    private       LayoutInflater inflater;

    {
        TAG = getClass().getSimpleName();
    }

    public AbsListAdapter(Context context) {
        this.context = context;
        this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    public AbsListAdapter(Context context, Collection<T> data) {
        this(context);
        this.mData = new ArrayList<T>(data);
    }

    public LayoutInflater getInflater() {
        return inflater;
    }

    public Context getContext() {
        return context;
    }

    protected abstract H getViewHolder(int position);

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        H holder;
        if (convertView == null) {
            holder = getViewHolder(position);
            convertView = inflater.inflate(holder.getLayoutId(position), parent, false);
            holder.create(convertView);
            convertView.setTag(R.id.tag_holder, holder);
        } else {
            holder = (H) convertView.getTag(R.id.tag_holder);
        }
        bindViewHolder(position, holder);
        return convertView;
    }

    protected void bindViewHolder(int position, H holder) {
        holder.bindValues(getItem(position), position);
    }

    @Override
    public int getCount() {
        return mData != null ? mData.size() : 0;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public T getItem(int position) {
        if (mData == null) {
            return null;
        }
        return mData.get(position);
    }

    public boolean addItem(T item) {
        if (mData == null) {
            mData = new ArrayList<T>();
        }
        if (item == null) {
            return false;
        }
        boolean ret = this.mData.add(item);
        notifyDataSetChanged();
        return ret;
    }

    public boolean addItems(Collection<T> items) {
        if (items == null) {
            throw new NullPointerException("params cannot be null");
        }
        if (mData == null) {
            mData = new ArrayList<T>(items.size());
        }
        boolean ret = this.mData.addAll(items);
        notifyDataSetChanged();
        return ret;
    }

    public boolean addItems(@NonNull T... items) {
        if (items == null) {
            throw new NullPointerException("params cannot be null");
        }
        if (mData == null) {
            mData = new ArrayList<T>(items.length);
        }
        boolean ret = Collections.addAll(mData, items);
        notifyDataSetChanged();
        return ret;
    }

    public boolean removeItem(T item) {
        if (mData == null) {
            return false;
        }
        boolean ret = this.mData.remove(item);
        notifyDataSetChanged();
        return ret;
    }

    public boolean removeItems(Collection<T> items) {
        if (mData == null) {
            return false;
        }
        boolean r = this.mData.removeAll(items);
        notifyDataSetChanged();
        return r;
    }

    public List<T> getSelectedItems(SparseBooleanArray checkedItems) {
        if (checkedItems == null) {
            throw new NullPointerException("params cannot be null");
        }
        if (mData == null) {
            return Collections.emptyList();
        }
        List<T> result = new ArrayList<T>();
        if (checkedItems != null) {
            for (int i = 0; i < mData.size(); i++) {
                if (checkedItems.get(i)) {
                    result.add(getItem(i));
                }
            }
        }
        return result;
    }

    public boolean refreshData() {
        notifyDataSetChanged();
        return false;
    }

    public boolean refreshData(Collection<T> data) {
        setData(data);
        notifyDataSetChanged();
        return false;
    }

    public List<T> getData() {
        return this.mData;
    }

    protected void setData(Collection<T> data) {
        this.mData = new ArrayList<T>(data);
    }

    public void removeItem(int pos) {
        removeItem(getItem(pos));
    }

    public void add(List<Integer> positions, List<T> items) {
        int threshold = positions.size() > items.size() ? items.size() : positions.size();
        for (int i = 0; i < threshold; i++) {
            getData().add(positions.get(i), items.get(i));
        }
        notifyDataSetChanged();
    }

    public void removeItems(int... positions) {
        if (mData == null) {
            return;
        }
        for (int position : positions) {
            if (mData.size() < position) {
                mData.remove(position);
            }
        }
        notifyDataSetChanged();
    }

    public void removeAll() {
        if (mData == null) {
            return;
        }
        mData.clear();
        notifyDataSetChanged();
    }
}


text:
'use strict'

angular.module('personalResumeApp')
.directive('toolbar', function() {
	return {
		restrict: 'AE',
		templateUrl: 'client/components/toolbar/toolbar.view.ng.html',
		replace: true
	};
})
.directive('navCollapse', function () {
    return {
        restrict: 'A',
        link: function (scope, element, attrs) {
            element.bind('click', function () {
            	angular.element('.navbar-toggle').trigger('click');
            });
        }
    };
});


text:
This is a character sheet for Serenity RPG.

This is based off of Kizyr's character sheet

Note: To clear Stuns, Wounds, and Shocks click on the respective logo