Coder Social home page Coder Social logo

samaritano's Introduction

Samaritano

A certain Samaritan, as he travelled, came where he was. When he saw, he was moved with compassion, came to him, and bound up his wounds, pouring on oil and wine. He set him on his own animal, and brought him to an inn, and took care of him. On the next day, when he departed, he took out two denarii, and gave them to the host, and said to him, take care of him.

As the good Samaritan of men, so too comes a good Samaritan for developers. The Samaritan is compassionate and caring, thinking of what he can do for another man. To be as a caretaker, not a hinderence; there when you need him.

samaritano's People

Watchers

James Cloos avatar

samaritano's Issues

Providing two or more of the same type in an event only uses the first provided type

E.g

import samaritano.event.EventManager;
import samaritano.event.Events;

public class Main {

	public static void main(String[] args) {

		EventManager manager = Events.manager();
		
		manager.register(new TestEventListener());
		
		manager.post(new TestEvent(1, 2, 3));

	}

}
import samaritano.event.EventListener;
import samaritano.event.Subscribe;

public class TestEventListener implements EventListener {
	
	@Subscribe(TestEvent.class)
	public void execute(int value1, int value2, int value3) {
		System.out.println(String.format("value1= %d value2= %d value3= %d", value1, value2, value3));
	}

}
import samaritano.event.Event;
import samaritano.event.Provide;

public class TestEvent implements Event {	
	
	@Provide
	private final int value1;	
	
	@Provide
	private final int value2;	
	
	@Provide
	private final int value3;	

	public TestEvent(int value1, int value2, int value3) {
		this.value1 = value1;
		this.value2 = value2;
		this.value3 = value3;
	}
	
}

Result is

value1= 1 value2= 1 value3= 1

Should be
value1= 1 value2= 2 value3= 3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.