This commit is contained in:
Kane Wang 2022-03-17 09:29:35 +08:00
parent 36166f5b60
commit 5825b7a929
3 changed files with 128 additions and 6 deletions

View File

@ -4,8 +4,72 @@ import java.util.Vector;
public class QWeatherDisasterWarning public class QWeatherDisasterWarning
{ {
private String code; public QWeatherDisasterWarning( String code,
private String updateTime; String updateTime,
private String flLink; String flLink,
private Vector<QWeatherDisasterWarningItem> warningItems; Vector<QWeatherDisasterWarningItem> warning,
QWeatherDisasterWarningRefer refer )
{
this.code = code;
this.updateTime = updateTime;
this.flLink = flLink;
this.warning = warning;
this.refer = refer;
}
public String getCode()
{
return code;
}
public void setCode( String code )
{
this.code = code;
}
public String getUpdateTime()
{
return updateTime;
}
public void setUpdateTime( String updateTime )
{
this.updateTime = updateTime;
}
public String getFlLink()
{
return flLink;
}
public void setFlLink( String flLink )
{
this.flLink = flLink;
}
public Vector<QWeatherDisasterWarningItem> getWarning()
{
return warning;
}
public void setWarning( Vector<QWeatherDisasterWarningItem> warning )
{
this.warning = warning;
}
public QWeatherDisasterWarningRefer getRefer()
{
return refer;
}
public void setRefer( QWeatherDisasterWarningRefer refer )
{
this.refer = refer;
}
private String code;
private String updateTime;
private String flLink;
private Vector<QWeatherDisasterWarningItem> warning;
private QWeatherDisasterWarningRefer refer;
} }

View File

@ -0,0 +1,56 @@
package com.cpic.xim.disaster_warning;
import java.util.Objects;
public class QWeatherDisasterWarningRefer
{
public QWeatherDisasterWarningRefer( String source, String license )
{
this.source = source;
this.license = license;
}
public String getSource()
{
return source;
}
public void setSource( String source )
{
this.source = source;
}
public String getLicense()
{
return license;
}
public void setLicense( String license )
{
this.license = license;
}
@Override
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
if ( o == null || getClass() != o.getClass() )
{
return false;
}
QWeatherDisasterWarningRefer that = (QWeatherDisasterWarningRefer) o;
return source.equals( that.source ) && license.equals( that.license );
}
@Override
public int hashCode()
{
return Objects.hash( source, license );
}
private String source;
private String license;
}

View File

@ -98,8 +98,10 @@ public class WeatherDisasterWarningGrabber
} }
} }
assert connection != null; if ( connection != null )
connection.disconnect(); {
connection.disconnect();
}
} }
return json; return json;