Skip to content

Instantly share code, notes, and snippets.

package cy.com.netinfo.util;
import java.util.Map;
public class Param<T> {
private String name;
private Class<T> tclass;
public Param(String name, Class<T> tclass) {
this.name = name;
@mark-jay
mark-jay / CustomClassloaderDemo.java
Last active August 29, 2015 14:10
Custom Classloader Demo
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.lang.reflect.Method;
/*
// somewhere else:
public class Main {
public String concat(String a, String b) {
@mark-jay
mark-jay / rsnapshot
Last active August 29, 2015 14:06
rsnapshot
#################################################
# rsnapshot.conf - rsnapshot configuration file #
#################################################
# #
# PLEASE BE AWARE OF THE FOLLOWING RULES: #
# #
# This file requires tabs between elements #
# #
# Directories require a trailing slash: #
# right: /home/ #
package kz.innoforce.isgp.form.values;
import kz.innoforce.isgp.form.values.component.ComponentAccess;
import kz.innoforce.isgp.form.values.component.IComponent;
import kz.innoforce.isgp.form.values.component.IComponentFactory;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
package kz.innoforce.isgp.form.values;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import java.lang.reflect.Method;
import java.math.BigDecimal;
public class FallenNotifyMeConf : IConf
{
public String getUser() { return "fallen"; }
public String getPassword() { return "fallen"; }
public String getServer() { return "notifyme.kz"; }
public int getPort() { return 80; }
public bool getVerbose() { return true; }
public String getNetworkHost() { return "notifyme.kz"; }
}
@mark-jay
mark-jay / gist:9341076
Last active August 29, 2015 13:56
Generics
public class Demo {
static class A<T> {}
static class B {}
static class C {}
static class AB extends A<B> {}
static class AC extends A<C> {}
static class AC1<T extends C> extends A<T> {}
static <T> void combine(A<T>... as){
public class ReturningGeneric {
public static class A{}
public static class B{}
@Test
public void method1() {
A a = method2(); // so good so far
B b = method2(); // error here
System.out.println(a + " " + b);
}