text:
package org.eclipse.collections.api.multimap;

import java.util.Collection;

import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.bag.Bag;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function0;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure2;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.set.SetIterable;
import org.eclipse.collections.api.tuple.Pair;

/**
 * This collection is a type of {@code Map} that can associate multiple values for keys.
 *

 *
Unlike {@code Map} however, this interface is read-only so the results of access methods such as {@link
 * #get(Object)} return a view onto the values associated with that key. The {@link MutableMultimap} subinterface
 * provides methods to mutate the collection.
 *

 *
The advantages to using this container over a {@code Map<K, Collection<V>>} is that all of the handling of the
 * value collection can be done automatically.  It also allows implementations to further specialize in how duplicate
 * values will be handled.  Value collections with list semantics would allow duplicate values for a key, while those
 * implementing set semantics would not. The value collections can never be empty.
 *

 *
Internal iteration methods for keys and values (singly - {@link #forEachKey(Procedure)}, {@link
 * #forEachValue(Procedure)}, and together - {@link #forEachKeyValue(Procedure2)}), {@link #forEachKeyMultiValues(Procedure2)}) are provided to allow flexible
 * browsing of the collection's contents.  Similarly, views also are provided for keys ({@link #keysView()}), values
 * ({@link #valuesView()}) and the combination thereof ({@link #keyValuePairsView()}, {@link
 * #keyMultiValuePairsView()}).
 *

 *
 * @param <K> the type of keys used
 * @param <V> the type of mapped values
 * @since 1.0
 */
@SuppressWarnings("JavaDoc")
public interface Multimap<K, V>
{
    /**
     * Creates a new instance of the same implementation type, using the default capacity and growth parameters.
     */
    Multimap<K, V> newEmpty();

    /**
     * Returns {@code true} if there are no entries.
     */
    boolean isEmpty();

    /**
     * Returns {@code true} if there is at least one entry.
     */
    boolean notEmpty();

    /**
     * Calls the procedure with each value.
     *

     * Given a Multimap with the contents:
     *

     * {@code { "key1" : ["val1", "val2", "val2"], "key2" : ["val3"] }}
     *

     * The given procedure would be invoked with the parameters:
     *

     * {@code [ "val1", "val2", "val2", "val3" ]}
     */
    void forEachValue(Procedure<? super V> procedure);

    /**
     * Calls the {@code procedure} with each key.
     *

     * Given a Multimap with the contents:
     *

     * {@code { "key1" : ["val1", "val2", "val2"], "key2" : ["val3"] }}
     *

     * The given procedure would be invoked with the parameters:
     *

     * {@code [ "key1", "key2" ]}
     */
    void forEachKey(Procedure<? super K> procedure);

    /**
     * Calls the {@code procedure} with each key-value pair.
     *

     * Given a Multimap with the contents:
     *

     * {@code { "key1" : ["val1", "val2", "val2"], "key2" : ["val3"] }}
     *

     * The given procedure would be invoked with the parameters:
     *

     * {@code [ ["key1", "val1"], ["key1", "val2"], ["key1", "val2"], ["key2", "val3"] ]}
     * @param procedure
     */
    void forEachKeyValue(Procedure2<? super K, ? super V> procedure);

    /**
     * Calls the {@code procedure} with each key-Iterable[value].
     *

     * Given a Multimap with the contents:
     *

     * {@code { "key1" : ["val1", "val2", "val2"], "key2" : ["val3"] }}
     *

     * The given procedure would be invoked with the parameters:
     *

     * {@code [ ["key1", {@link RichIterable["val1", "val2", "val2"]}], ["key2", {@link RichIterable["val3"]}] ]}
     *
     * @since 6.0
     * @param procedure
     */
    void forEachKeyMultiValues(Procedure2<? super K, ? super Iterable<V>> procedure);

    /**
     * Returns the number of key-value entry pairs.
     *

     * This method is implemented with O(1) (constant-time) performance.
     */
    int size();

    /**
     * Returns the number of distinct keys.
     */
    int sizeDistinct();

    /**
     * Returns {@code true} if any values are mapped to the specified key.
     *
     * @param key the key to search for
     */
    boolean containsKey(Object key);

    /**
     * Returns {@code true} if any key is mapped to the specified value.
     *
     * @param value the value to search for
     */
    boolean containsValue(Object value);

    /**
     * Returns {@code true} if the specified key-value pair is mapped.
     *
     * @param key   the key to search for
     * @param value the value to search for
     */
    boolean containsKeyAndValue(Object key, Object value);

    /**
     * Returns a view of all values associated with the given key.
     *

     * If the given key does not exist, an empty {@link RichIterable} is returned.
     *
     * @param key the key to search for
     */
    RichIterable<V> get(K key);

    /**
     * Returns a lazy view of the unique keys.
     */
    RichIterable<K> keysView();

    /**
     * Returns a unmodifiable {@link SetIterable} of keys with O(1) complexity.
     */
    SetIterable<K> keySet();

    /**
     * Returns a {@link Bag} of keys with the count corresponding to the number of mapped values.
     */
    Bag<K> keyBag();

    /**
     * Returns an unmodifiable view of all of the values mapped to each key.
     */
    RichIterable<RichIterable<V>> multiValuesView();

    /**
     * Returns a lazy flattened view of all the values.
     */
    RichIterable<V> valuesView();

    /**
     * Returns a lazy view of the pair of a key and and a lazy view of the values mapped to that key.
     */
    RichIterable<Pair<K, RichIterable<V>>> keyMultiValuePairsView();

    /**
     * Returns a lazy view of all of the key/value pairs.
     */
    RichIterable<Pair<K, V>> keyValuePairsView();

    /**
     * Returns a new {@link MutableMap} of keys from this Multimap to the mapped values as a {@link RichIterable}.
     */
    MutableMap<K, RichIterable<V>> toMap();

    /**
     * Returns a new {@link MutableMap} of keys from this Multimap to the mapped values as a {@link RichIterable}.
     *
     * @param collectionFactory used to create the collections that hold the values and affects the return type
     */
    <R extends Collection<V>> MutableMap<K, R> toMap(Function0<R> collectionFactory);

    /**
     * Compares the specified object with this Multimap for equality.
     *

     * Two Multimaps are equal when their map views (as returned by {@link #toMap}) are also equal.
     *

     * In general, two Multimaps with identical key-value mappings may or may not be equal, depending on the type of
     * the collections holding the values. If the backing collections are Sets, then two instances with the same
     * key-value mappings are equal, but if the backing collections are Lists, equality depends on the ordering of the
     * values for each key.
     *

     * Any two empty Multimaps are equal, because they both have empty {@link #toMap} views.
     */
    @Override
    boolean equals(Object obj);

    /**
     * Returns the hash code for this Multimap.
     *

     * The hash code of a Multimap is defined as the hash code of the map view, as returned by {@link #toMap}.
     */
    @Override
    int hashCode();

    /**
     * Returns a mutable copy of this Multimap.
     */
    MutableMultimap<K, V> toMutable();

    /**
     * Returns an immutable copy of this Multimap if it is not already immutable. If the Multimap is immutable,
     * it will return itself.
     *

     * The returned Multimap will be {@code Serializable} if this Multimap is {@code Serializable}.
     */
    ImmutableMultimap<K, V> toImmutable();

    /**
     * Given a Multimap from Domain -> Range return a multimap from Range -> Domain.
     *
     * @since 6.0
     */
    Multimap<V, K> flip();

    /**
     * Returns all elements of the source multimap that satisfies the predicate.  This method is also
     * commonly called filter.
     *

     *
e.g.
     * return multimap.selectKeysValues(new Predicate2<Integer, Person>()
     * {
     *     public boolean accept(Integer age, Person person)
     *     {
     *         return (age >= 18)
     *                  && (person.getAddress().getCity().equals("Metuchen"));
     *     }
     * });
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the select criteria
     * @return {@code Multimap}, which contains elements as a result of the select criteria
     * @since 6.0
     */
    Multimap<K, V> selectKeysValues(Predicate2<? super K, ? super V> predicate);

    /**
     * Same as the select method but uses the specified target multimap for the results.
     *

     *
e.g.
     * return multimap.selectKeysValues(new Predicate2<Integer, Person>()
     * {
     *     public boolean accept(Integer age, Person person)
     *     {
     *         return (age >= 18)
     *                  && (person.getAddress().getCity().equals("Metuchen"));
     *     }
     * }, FastListMultimap.newMultimap());
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the select criteria
     * @param target    the Multimap to append to for all elements in this {@code Multimap} that satisfy the {@code predicate}
     * @return {@code target}, which contains appended elements as a result of the select criteria
     * @since 6.0
     */
    <R extends MutableMultimap<K, V>> R selectKeysValues(Predicate2<? super K, ? super V> predicate, R target);

    /**
     * Returns all elements of the source multimap that don't satisfy the predicate.
     *

     *
e.g.
     * return multimap.rejectKeysValues(new Predicate2<Integer, Person>()
     * {
     *     public boolean accept(Integer age, Person person)
     *     {
     *         return (age >= 18)
     *                  && (person.getAddress().getCity().equals("Metuchen"));
     *     }
     * });
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the reject criteria
     * @return {@code Multimap}, which contains elements that don't satisfy the {@code predicate}
     * @since 6.0
     */
    Multimap<K, V> rejectKeysValues(Predicate2<? super K, ? super V> predicate);

    /**
     * Same as the reject method but uses the specified target multimap for the results.
     *

     *
e.g.
     * return multimap.rejectKeysValues(new Predicate2<Integer, Person>()
     * {
     *     public boolean accept(Integer age, Person person)
     *     {
     *         return (age >= 18)
     *                  && (person.getAddress().getCity().equals("Metuchen"));
     *     }
     * }, FastListMultimap.newMultimap());
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the reject criteria
     * @param target    the Multimap to append to for all elements in this {@code Multimap} that don't satisfy the {@code predicate}
     * @return {@code target}, which contains appended elements that don't satisfy the {@code predicate}
     * @since 6.0
     */
    <R extends MutableMultimap<K, V>> R rejectKeysValues(Predicate2<? super K, ? super V> predicate, R target);

    /**
     * Returns all elements of the source multimap that satisfies the predicate.  This method is also
     * commonly called filter.
     *

     *
e.g.
     * return multimap.selectKeysMultiValues(new Predicate2<Integer, Iterable<Person&gt>()
     * {
     *     public boolean accept(Integer age, Iterable<Person> values)
     *     {
     *         return (age >= 18)
     *                  && ((RichIterable<Person>)values.size() >= 2);
     *     }
     * });
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the select criteria
     * @return {@code Multimap}, which contains elements as a result of the select criteria
     * @since 6.0
     */
    Multimap<K, V> selectKeysMultiValues(Predicate2<? super K, ? super Iterable<V>> predicate);

    /**
     * Same as the select method but uses the specified target multimap for the results.
     *

     *
e.g.
     * return multimap.selectKeysMultiValues(new Predicate2<Integer, Iterable<Person&gt>()
     * {
     *     public boolean accept(Integer age, Iterable<Person> values)
     *     {
     *         return (age >= 18)
     *                  && ((RichIterable<Person>)values.size() >= 2);
     *     }
     * }, FastListMultimap.newMultimap());
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the select criteria
     * @param target    the Multimap to append to for all elements in this {@code Multimap} that satisfy the {@code predicate}
     * @return {@code target}, which contains appended elements as a result of the select criteria
     * @since 6.0
     */
    <R extends MutableMultimap<K, V>> R selectKeysMultiValues(Predicate2<? super K, ? super Iterable<V>> predicate, R target);

    /**
     * Returns all elements of the source multimap that don't satisfy the predicate.
     *

     *
e.g.
     * return multimap.rejectKeysMultiValues(new Predicate2<Integer, Iterable<Person&gt>()
     * {
     *     public boolean accept(Integer age, Iterable<Person> values)
     *     {
     *         return (age >= 18)
     *                  && ((RichIterable<Person>)values.size() >= 2);
     *     }
     * });
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the reject criteria
     * @return {@code Multimap}, which contains elements that don't satisfy the {@code predicate}
     * @since 6.0
     */
    Multimap<K, V> rejectKeysMultiValues(Predicate2<? super K, ? super Iterable<V>> predicate);

    /**
     * Same as the reject method but uses the specified target multimap for the results.
     *

     *
e.g.
     * return multimap.rejectKeysMultiValues(new Predicate2<Integer, Iterable<Person&gt>()
     * {
     *     public boolean accept(Integer age, Iterable<Person> values)
     *     {
     *         return (age >= 18)
     *                  && ((RichIterable<Person>)values.size() >= 2);
     *     }
     * }, FastListMultimap.newMultimap());
     *

     *

     *
     * @param predicate a {@link Predicate2} to use as the reject criteria
     * @param target    the Multimap to append to for all elements in this {@code Multimap} that don't satisfy the {@code predicate}
     * @return {@code target}, which contains appended elements that don't satisfy the {@code predicate}
     * @since 6.0
     */
    <R extends MutableMultimap<K, V>> R rejectKeysMultiValues(Predicate2<? super K, ? super Iterable<V>> predicate, R target);

    /**
     * Returns a new multimap with the results of applying the specified function on each key and value of the source
     * multimap.  This method is also commonly called transform or map.
     *

     *
e.g.
     * return multimap.collectKeysValues(new Function2<Integer, Person, Pair<String, String&gt>()
     * {
     *     public Pair<String, String> valueOf(Integer age, Person person)
     *     {
     *         return Tuples.pair(age.toString(), person.getLastName());
     *     }
     * });
     *

     *
     * @param function a {@link Function2} to use for transformation
     * @return {@code Multimap}, which contains elements as a result of the transformation
     * @since 6.0
     */
    <K2, V2> Multimap<K2, V2> collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function);

    /**
     * Same as the collect method but uses the specified target multimap for the results.
     *

     *
e.g.
     * return multimap.collectKeysValues(new Function2<Integer, Person, Pair<String, String&gt>()
     * {
     *     public Pair<String, String> valueOf(Integer age, Person person)
     *     {
     *         return Tuples.pair(age.toString(), person.getLastName());
     *     }
     * }, HashBagMultimap.<String, String>newMultimap());
     *

     *
     * @param function a {@link Function2} to use for transformation
     * @param target   the Multimap to append for all elements in this {@code Multimap} that are evaluated in {@code function}
     * @return {@code target}, which contains appended elements as a result of the transformation
     * @since 6.0
     */
    <K2, V2, R extends MutableMultimap<K2, V2>> R collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function, R target);

    /**
     * Returns a new multimap with the results of applying the specified function on each value of the source
     * multimap.  This method is also commonly called transform or map.
     *

     *
e.g.
     * return multimap.collectValues(new Function<Person, String>()
     * {
     *     public String valueOf(Person person)
     *     {
     *         return person.getLastName();
     *     }
     * });
     *

     *
     * @param function a {@link Function} to use for transformation
     * @return {@code Multimap}, which contains elements as a result of the transformation
     * @since 6.0
     */
    <V2> Multimap<K, V2> collectValues(Function<? super V, ? extends V2> function);

    /**
     * Same as the collect method but uses the specified target multimap for the results.
     *

     *
e.g.
     * return multimap.collectValues(new Function<Person, String>()
     * {
     *     public String valueOf(Person person)
     *     {
     *         return person.getLastName();
     *     }
     * }, FastListMultimap.<Integer, String>newMultimap());
     *

     *
     * @param function a {@link Function} to use for transformation
     * @param target   the Multimap to append for all elements in this {@code Multimap} that are evaluated in {@code function}
     * @return {@code target}, which contains appended elements as a result of the transformation
     * @since 6.0
     */
    <V2, R extends MutableMultimap<K, V2>> R collectValues(Function<? super V, ? extends V2> function, R target);
}


text:
function(c,v) {
  if (!is$(c,{t:this.tipo.$m$.$cont}))throw IncompatibleTypeException$meta$model("Incompatible container type");
  if (!is$(v,this.tipo.$m$.$t))throw IncompatibleTypeException$meta$model("Incompatible value type");
  if (!this.tipo.set)throw MutationException$meta$model(qname$(this.tipo.$m$)+" is not writable");
  c[this.name]=v;
}

redpajama_set_name: RedPajamaGithub


text:
package dto.system;

/**
 * Created by scott on 2017/3/17.
 */
public class MenuDTO{
    private String url;

    private String name;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


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

describe LoopDance::Task do

  describe "setup" do

    let(:interval) { 60 }
    let(:dancer) { LoopDance::Dancer }

    before {
      @result = 0
      @task = LoopDance::Task.new dancer, interval do
        @result+=1
      end
    }

    subject { @task }

    it "should setup instance variables" do
      subject.interval.to_i.should be 60
      subject.block.should be_a Proc
    end

    it "should run block" do
      @result.should == 0
      subject.run
      @result.should == 1
      subject.last_run_at.should < Time.now
    end

    it "should  run straight away" do
      should be_time_to_run
    end

    it "should run if it's time" do
      t = Time.now()
      Time.stub(:now).and_return(t + interval)
      should be_time_to_run
    end

  end

end


text:
namespace ID
{
	SymlinkHandle::SymlinkHandle()
	{
	}

	SymlinkHandle::SymlinkHandle(std::string const & link, std::string const & target) :
		m_link(link), m_target(target)
	{
		createSymlink(link, target);
	}

	SymlinkHandle::~SymlinkHandle()
	{
		try
		{
			reset();
		}
		catch (std::exception const & e)
		{
			// Swallow exceptions during destruction
		}
	}

	SymlinkHandle::SymlinkHandle(SymlinkHandle && other) noexcept :
		m_link(std::move(other.m_link)), m_target(std::move(other.m_target))
	{
		other.m_link.clear();
		other.m_target.clear();
	}

	SymlinkHandle & SymlinkHandle::operator=(SymlinkHandle && other)
	{
		swap(m_link, other.m_link);
		other.reset();
		return *this;
	}

	void SymlinkHandle::reset()
	{
		if (!m_link.empty())
		{
			removeFSObject(m_link);
			m_link.clear();
			m_target.clear();
		}
	}

	std::string const & SymlinkHandle::link() const
	{
		return m_link;
	}

	std::string const & SymlinkHandle::target() const
	{
		return m_target;
	}
}


text:
<?php

/**
* <auto-generated>
*     This code was generated by Codezu.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

namespace Mozu\Api\Clients\Commerce\Customer;

use Mozu\Api\MozuClient;
use Mozu\Api\Urls\Commerce\Customer\CustomerSetUrl;

/**
*
*/
class CustomerSetClient {

	/**
	*
	*
	* @param int $pageSize
	* @param string $responseFields
	* @param string $sortBy
	* @param int $startIndex
	* @return MozuClient
	*/
	public static function getCustomerSetsClient($startIndex =  null, $pageSize =  null, $sortBy =  null, $responseFields =  null)
	{
		$url = CustomerSetUrl::getCustomerSetsUrl($pageSize, $responseFields, $sortBy, $startIndex);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	*
	*
	* @param string $code
	* @param string $responseFields
	* @return MozuClient
	*/
	public static function getCustomerSetClient($code, $responseFields =  null)
	{
		$url = CustomerSetUrl::getCustomerSetUrl($code, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

}

?>


text:
# TypeScript typings for Google Container Engine API v1
The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.
For detailed description please check [documentation](https://cloud.google.com/container-engine/).

## Installing

Install typings for Google Container Engine API:
```
npm install @types/gapi.client.container@v1 --save-dev
```

## Usage

You need to initialize Google API client in your code:
```typescript
gapi.load("client", () => {
    // now we can use gapi.client
    // ...
});
```

Then load api client wrapper:
```typescript
gapi.client.load('container', 'v1', () => {
    // now we can use gapi.client.container
    // ...
});
```

Don't forget to authenticate your client before sending any request to resources:
```typescript

// declare client_id registered in Google Developers Console
var client_id = '',
    scope = [
        // View and manage your data across Google Cloud Platform services
        'https://www.googleapis.com/auth/cloud-platform',
    ],
    immediate = true;
// ...

gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
    if (authResult && !authResult.error) {
        /* handle succesfull authorization */
    } else {
        /* handle authorization error */
    }
});
```

After that you can use Google Container Engine API resources:

```typescript
```


text:
package com.hyh.common.picasso;

import android.content.ContentResolver;
import android.content.Context;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import static android.content.ContentResolver.SCHEME_CONTENT;

class ContentStreamRequestHandler extends RequestHandler {
    final Context context;

    ContentStreamRequestHandler(Context context) {
        this.context = context;
    }

    @Override
    public boolean canHandleRequest(Request data) {
        return SCHEME_CONTENT.equals(data.uri.getScheme());
    }

    @Override
    public Result load(Request request, int networkPolicy) throws IOException {
        return new Result(getInputStream(request), NativePicasso.LoadedFrom.DISK);
    }

    InputStream getInputStream(Request request) throws FileNotFoundException {
        ContentResolver contentResolver = context.getContentResolver();
        return contentResolver.openInputStream(request.uri);
    }
}


text:
(function(){
    'use strict';

    angular.module('iLocation')
        .factory('HomeService', HomeService);

        HomeService.$inject=['$resource','$rootScope'];

        function HomeService($resource,$rootScope){

            return null

        }

})();


text:
using System.Windows.Forms;

namespace ProSnap
{
    public class ShortcutItem
    {
        public bool Enabled { get; set; }
        public bool RequirePreviewOpen { get; set; }
        public KeyCombo KeyCombo { get; set; }
        public ProgramActionChain ActionChain { get; set; }

        public ShortcutItem(bool enabled, bool requirePreviewOpen, KeyCombo keyCombo, ProgramActionChain actionChain)
        {
            this.Enabled = enabled;
            this.RequirePreviewOpen = requirePreviewOpen;
            this.KeyCombo = keyCombo;
            this.ActionChain = actionChain;
        }

        public static ShortcutItem Empty()
        {
            return new ShortcutItem(false, false, new KeyCombo(Keys.None), new ProgramActionChain("New Action Chain"));
        }

        public override string ToString()
        {
            return string.Format("[{0}]: {1}", this.KeyCombo, this.ActionChain);
        }
    }
}


text:
module CitiesByCountry
  VERSION = "0.0.1"
end


text:
function Add-VSIoTAnalyticsPipelineDeviceRegistryEnrich {
    <#
    .SYNOPSIS
        Adds an AWS::IoTAnalytics::Pipeline.DeviceRegistryEnrich resource property to the template. An activity that adds data from the AWS IoT device registry to your message.

    .DESCRIPTION
        Adds an AWS::IoTAnalytics::Pipeline.DeviceRegistryEnrich resource property to the template.
An activity that adds data from the AWS IoT device registry to your message.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-pipeline-deviceregistryenrich.html

    .PARAMETER Attribute
        The name of the attribute that is added to the message.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-pipeline-deviceregistryenrich.html#cfn-iotanalytics-pipeline-deviceregistryenrich-attribute
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Next
        The next activity in the pipeline.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-pipeline-deviceregistryenrich.html#cfn-iotanalytics-pipeline-deviceregistryenrich-next
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER ThingName
        The name of the IoT device whose registry information is added to the message.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-pipeline-deviceregistryenrich.html#cfn-iotanalytics-pipeline-deviceregistryenrich-thingname
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER RoleArn
        The ARN of the role that allows access to the device's registry information.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-pipeline-deviceregistryenrich.html#cfn-iotanalytics-pipeline-deviceregistryenrich-rolearn
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Name
        The name of the 'deviceRegistryEnrich' activity.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-pipeline-deviceregistryenrich.html#cfn-iotanalytics-pipeline-deviceregistryenrich-name
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>
    [OutputType('Vaporshell.Resource.IoTAnalytics.Pipeline.DeviceRegistryEnrich')]
    [cmdletbinding()]
    Param
    (
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Attribute,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Next,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $ThingName,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $RoleArn,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Name
    )
    Begin {
        $obj = [PSCustomObject]@{}
        $commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
    }
    Process {
        foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
            switch ($key) {
                Default {
                    $obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
                }
            }
        }
    }
    End {
        $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.IoTAnalytics.Pipeline.DeviceRegistryEnrich'
        Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
    }
}


text:
package com.zenfield.core;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.List;
import java.util.function.Predicate;

/**
 *
 * @author MICSKO Viktor (viktor@zenfield.com)
 */
public class Processes {

	public static Integer execute(String command, List<String> output) throws IOException {
		Check.notEmpty(command);
		Check.notNull(output);

		Process process = Runtime.getRuntime().exec(command);
		return execute(process, output);
	}

	public static Integer execute(ProcessBuilder builder, List<String> output) throws IOException {
		Check.notNull(builder);
		Check.notNull(output);

		builder.redirectOutput(ProcessBuilder.Redirect.PIPE);
		builder.redirectError(ProcessBuilder.Redirect.INHERIT);
		return execute(builder.start(), output);
	}

	public static Integer execute(Process process, List<String> output) throws IOException {
		Check.notNull(process);
		Check.notNull(output);

		InputStream is = process.getInputStream();
		if (is == null) {
			return null;
		}

		BufferedReader reader = null;

		try {
			reader = new BufferedReader(new InputStreamReader(is));

			String line;
			while ((line = reader.readLine()) != null) {
				output.add(line);
			}

			try {
				return process.waitFor();

			} catch (InterruptedException e) {
				return null;
			}

		} finally {
			Closeables.close(reader);
		}
	}

	public static Integer save(ProcessBuilder builder, File output) throws IOException {
		return save(builder, line -> true, output);
	}

	public static Integer save(ProcessBuilder builder, Predicate<String> filter, File output) throws IOException {
		Check.notNull(builder);
		Check.notNull(output);

		builder.redirectOutput(ProcessBuilder.Redirect.PIPE);
		builder.redirectError(ProcessBuilder.Redirect.INHERIT);
		return save(builder.start(), filter, output);
	}

	public static Integer save(Process process, Predicate<String> filter, File output) throws IOException {
		Check.notNull(process);
		Check.notNull(filter);
		Check.notNull(output);

		InputStream is = process.getInputStream();
		if (is == null) {
			return null;
		}

		BufferedReader reader = new BufferedReader(new InputStreamReader(is));

		Writer writer = null;

		try {
			writer = new FileWriter(output);

			for (;;) {
				String line = reader.readLine();
				if (line == null) {
					break;
				}

				if (!filter.test(line)) {
					continue;
				}

				writer.write(line);
				writer.write('\n');
			}

			try {
				return process.waitFor();

			} catch (InterruptedException e) {
				return null;
			}

		} finally {
			Closeables.close(reader);
			Closeables.close(writer);
		}
	}

	public static void destroy(Process process) {
		if (process != null) {
			process.destroy();
		}
	}
}