Example usage for org.joda.time LocalDateTime LocalDateTime

List of usage examples for org.joda.time LocalDateTime LocalDateTime

Introduction

In this page you can find the example usage for org.joda.time LocalDateTime LocalDateTime.

Prototype

public LocalDateTime(Object instant) 

Source Link

Document

Constructs an instance from an Object that represents a datetime.

Usage

From source file:org.onosproject.mastership.MastershipEvent.java

License:Apache License

@Override
public String toString() {
    return MoreObjects.toStringHelper(getClass()).add("time", new LocalDateTime(time())).add("type", type())
            .add("subject", subject()).add("roleInfo", roleInfo).toString();
}

From source file:org.onosproject.net.config.NetworkConfigEvent.java

License:Apache License

@Override
public String toString() {
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("config", config()).add("prevConfig", prevConfig()).add("configClass", configClass())
            .toString();/*from www . j  av a 2  s  .  c  o m*/
}

From source file:org.onosproject.net.device.DeviceEvent.java

License:Apache License

@Override
public String toString() {
    if (port == null) {
        return super.toString();
    }//from  ww w . j  a v  a2 s. c  om
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("subject", subject()).add("port", port).toString();
}

From source file:org.onosproject.net.driver.DriverEvent.java

License:Apache License

@Override
public String toString() {
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("subject", subject()).toString();
}

From source file:org.onosproject.openstacknetworking.api.OpenstackNetworkEvent.java

License:Apache License

@Override
public String toString() {
    if (port == null && subnet == null) {
        return super.toString();
    }//from  w w  w . j av  a 2s .c  om
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("network", subject()).add("port", port).add("subnet", subnet).toString();
}

From source file:org.onosproject.openstacknetworking.api.OpenstackRouterEvent.java

License:Apache License

@Override
public String toString() {
    if (floatingIP == null) {
        return super.toString();
    }//from ww  w.  jav  a 2  s  .  c  om
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("router", subject()).add("externalGateway", exGateway).add("routerIface", routerIface)
            .add("floatingIp", floatingIP).add("portId", portId).toString();
}

From source file:org.onosproject.openstacknode.OpenstackNodeEvent.java

License:Apache License

@Override
public String toString() {
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("state", type())
            .add("node", subject()).toString();
}

From source file:org.onosproject.routeservice.RouteEvent.java

License:Apache License

@Override
public String toString() {
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("subject", subject()).add("prevSubject", prevSubject).add("alternatives", alternativeRoutes)
            .add("prevAlternatives", prevAlternativeRoutes).toString();
}

From source file:org.opencord.cordvtn.api.core.ServiceNetworkEvent.java

License:Apache License

@Override
public String toString() {
    if (servicePort == null) {
        return super.toString();
    }// ww w.jav  a 2s .  co  m
    return toStringHelper(this).add("time", new LocalDateTime(time())).add("type", type())
            .add("serviceNetwork", subject()).add("servicePort", servicePort).add("provider", provider)
            .toString();
}

From source file:org.openhab.io.caldav.internal.job.EventReloaderJob.java

License:Open Source License

private org.joda.time.DateTime getDateTime(String dateType, DateTime date, Date rangeDate) {
    org.joda.time.DateTime start;/*w w  w.  j a va  2  s . com*/
    if (date.getTimeZone() == null) {
        if (date.isUtc()) {
            log.trace("{} is without timezone, but UTC", dateType);
            start = new org.joda.time.DateTime(rangeDate, DateTimeZone.UTC).toLocalDateTime()
                    .toDateTime(CalDavLoaderImpl.defaultTimeZone);
        } else {
            log.trace("{} is without timezone, not UTC", dateType);
            start = new LocalDateTime(rangeDate).toDateTime();
        }
    } else if (DateTimeZone.getAvailableIDs().contains(date.getTimeZone().getID())) {
        log.trace("{} is with known timezone: {}", dateType, date.getTimeZone().getID());
        start = new org.joda.time.DateTime(rangeDate, DateTimeZone.forID(date.getTimeZone().getID()));
    } else {
        // unknown timezone
        log.trace("{} is with unknown timezone: {}", dateType, date.getTimeZone().getID());
        start = new org.joda.time.DateTime(rangeDate, CalDavLoaderImpl.defaultTimeZone);
    }
    return start;
}