package com.apobates.forum.event.utils;

import com.apobates.forum.event.elderly.IpLocation;

/**
 * 中合:com.apobates.forum.event.elderly.IpLocation - com.apobates.forum.thrones.controller.helper.IpMatchResult
 * @author xiaofanku
 * @since 20200530
 */
public class IpMatchLocationResult implements IpLocation{
    private final IpMatchResult result;
    
    public IpMatchLocationResult(String ipAddr) {
        this.result = IpMatcher.getInstance().matchToResult(ipAddr).orElse(IpMatchResult.empty(ipAddr));
    }
    
    @Override
    public String getIpAddr() {
        return result.getIpAddr();
    }
    
    @Override
    public String getIsp() {
        return result.getIsp();
    }
    
    @Override
    public String getProvince() {
        return result.getProvince();
    }
    
    @Override
    public String getCity() {
        return result.getCity();
    }
    
    @Override
    public String getDistrict() {
        return result.getDistrict();
    }
}