Skip to content

Java 7 to java 8

Featured Replies

hi, i have a question about (  ->  ) on java 8. this arrow is what code in java 7?
 

Sorry for bad en, and thanks for who can help me.

5 minutes ago, maldito171 said:

hi, i have a question about (  ->  ) on java 8. this arrow is what code in java 7?
 

Sorry for bad en, and thanks for who can help me.

 

That is lamba expression. Write me down the code from java 8. 

  • Author

    

	
	public static void changeProcess(BanProssesInfo process)
	{
		BanProssesInfo prosess = conteins(process);
		
		if (prosess != null)
			_list.remove(prosess);
		else
			_list.add(process);
		
		updateData();
		
		L2World.getInstance().getPlayers().stream().filter(player -> player.isOnline() && !player.getClient().getInformation().isOfflineShop()).forEach(pl -> _list.forEach(pros -> pl.sendPacket(new BlockedProcessUpdate(pros))));
	}
	

Thanks man.
 

Sem título.png

You can use lamba instead of a for loop, add it to the runnable call method, and so on.

getPlayers() seems wrong method name, it can be getAllPlayers() or so. Check your L2World for proper name.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.